js|数据|数据库<script language="javascript" runat="server">
var conn=new ActiveXObject("ADODB.Connection");
conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("data.mdb");
conn.Open();
var rs = new ActiveXObject("ADODB.Recordset");
rs.LockType=rs.CursorType=1;
//rs.ActiveConnection=conn;
//rs.Source="SELECT id,text FROM [Tree]";
var sql="SELECT id,text FROM [Tree]";
rs.Open(sql,conn);
while (!rs.EOF)
...{
Response.Write(rs("text")+" ");
rs.MoveNext();
}
rs.Close;
rs=null;
conn.Close();
conn=null;
</script>
js操作数据库
80酷酷网 80kuku.com