类型不匹配: 'getrecordset'

来源:百度知道 编辑:UC知道 时间:2024/05/15 02:30:11
<!--#include file="adofunction.asp"-->
<%
userID=trim(request("ID"))
userPassword=trim(request("Password"))
if (userid="" or userpassword="") then
response.redirect"主页2.html"
response.end
end if
dim strsql,rs
strsql="select * from user where id='"&userid&"'"
strsql=strsql & "and password='"&userpassword&"'"
set rs=getrecordset(strsql)
if rs.eof then
response.write"用户名或密码错误"
response.end
end if
response.cookies("id")=userid
response.cookies("password")=userpassword
response.cookies("passed")="passed"
response.redirect"5-7.asp"
%>

错误提示具体是:
if rs.eof then
response.write"用户名或密码错误"
response.end
end if[0]Script error detected at line 29,col[0].
Descrip

变量rs不是recordset类型,应使用set rs=server.createobject("adodb.recordset")语句来建立一个recordset类型变量,而不是用dim语句.
还有,你的自定义的函数名称好像也写错了