时间:2021-07-01 10:21:17 帮助过:67人阅读
<% Set conn= Server.CreateObject("ADODB.Connection") connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("db2.mdb") conn.Open connstr Set rs = Server.CreateObject ("ADODB.Recordset") sql = "Select * from people order by id desc" rs.Open sql,conn,1,1 Do While Not rs.EOF Response.write rs("id")&" | " rs.MoveNext Loop %> |
<% Set conn = Server.CreateObject("ADODB.Connection") Set cmd = Server.CreateObject("ADODB.Command") conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("db2.mdb") cmd.ActiveConnection = conn cmd.CommandText = "Select * from people order by id desc" Set rs = cmd.Execute Do While Not rs.EOF Response.write rs("id")&" | " rs.MoveNext Loop %> |
<% Set conn = Server.CreateObject("ADODB.Connection") Set cmd = Server.CreateObject("ADODB.Command") conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("db2.mdb") cmd.ActiveConnection = conn cmd.CommandText = "Select * from people order by id desc" Set rs = cmd.Execute rsArray = rs.GetRows() For i = 0 To UBound(rsArray, 2) Response.Write rsArray(0, i)&" | " Next %> |