谁来帮我做个遥控器? ( 积分: 100 )

  • 主题发起人 主题发起人 sikaman
  • 开始时间 开始时间
我不懂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") 这句错了?
 
好像ID没有被赋值?该怎么做呀?
 
搞定!
asp是这样写的:
<!-- #include file="ADOFunctions.asp" -->
<%
ID=Request.QueryString("ID")
' response.write 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

%>
DELPHI就省略了!散分咯......
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
908
SUNSTONE的Delphi笔记
S
S
回复
0
查看
885
SUNSTONE的Delphi笔记
S
后退
顶部