下面是引用setiufo於2006-10-2 22:27發表的 :
紅色的地方是需要修改的嗎?
<%
Dim Rectest
Dim Rectest_numRows
strConn1 = "DRIVER={Microsoft Access Driver(*.mdb)};DBQ=" & Server.Mappath(YourDB.mdb)
.......
<%
Dim Rectest
Dim Rectest_numRows
strConn1 = "DRIVER={Microsoft Access Driver(*.mdb)};DBQ=" & Server.Mappath(
YourDB.mdb)
Set
objDBcon1 = Server.CreateObject("ADODB.Connection")
objDBcon1.Open strConn1
Set Rectest = Server.CreateObject("ADODB.Recordset")
Rectest.ActiveConnection = objDBcon1
Rectest.Source = "SELECT * FROM t1"
Rectest.CursorType = 0
Rectest.CursorLocation = 2
Rectest.LockType = 1
Rectest.Open()
Rectest_numRows = 0
%>