S
sikaman
Unregistered / Unconfirmed
GUEST, unregistred user!
我不懂ASP,翻看一些资料和参照iamy的提示,写了下面的东西
<!-- #include file="ADOFunctions.asp" -->
<%
ID=Request.Form("ID"
Dim objRS
Set objRS = GetSQLRecordset("select * from tab_id where key_id='ID'","setkey.mdb", "tab_id"
If OBJRS.RecordCount>0 then
Response.Write("Stop"
else
Response.Write("Go"
end if
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
其中 引用了函数摘抄如下
Function GetSQLRecordset(strSQL, FileName, TableName)
'使用Connection对象打开数据库
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath(FileName)
objConn.Open
'从数据表中读取符合SQL语句的记录并存放在Recordset对象中
Set GetSQLRecordset = Server.CreateObject("ADODB.Recordset"
GetSQLRecordset.Open strSQL, objConn, adOpenKeyset, adLockOptimistic, adCmdText
End Function
运行后结果不对!?
是不是我 Set objRS = GetSQLRecordset("select * from tab_id where key_id='ID'","setkey.mdb", "tab_id" 这句错了?
<!-- #include file="ADOFunctions.asp" -->
<%
ID=Request.Form("ID"
Dim objRS
Set objRS = GetSQLRecordset("select * from tab_id where key_id='ID'","setkey.mdb", "tab_id"
If OBJRS.RecordCount>0 then
Response.Write("Stop"
else
Response.Write("Go"
end if
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
其中 引用了函数摘抄如下
Function GetSQLRecordset(strSQL, FileName, TableName)
'使用Connection对象打开数据库
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath(FileName)
objConn.Open
'从数据表中读取符合SQL语句的记录并存放在Recordset对象中
Set GetSQLRecordset = Server.CreateObject("ADODB.Recordset"
GetSQLRecordset.Open strSQL, objConn, adOpenKeyset, adLockOptimistic, adCmdText
End Function
运行后结果不对!?
是不是我 Set objRS = GetSQLRecordset("select * from tab_id where key_id='ID'","setkey.mdb", "tab_id" 这句错了?