有两个关于ado对象应用的问题
问题1
下面是一段程序:
<%
dim username
dim password
dim RS
dim sql
username=Request.Form("username")
password=Request.Form("password")
if (username <>"" and password <>"") then
sql ="select * from check where sname ='"& username &"'and spwd='"& password &"'"
Set adoconn=Server.CreateObject("ADODB.Connection")
adoconn.Open "DSN=system;UID=sa;PWD=sa;Database=shiyan"
set RS=adoconn.execute(sql)
if RS.EOF then
response.write"非法用户"
RS.Close
set RS = nothing
adoconn.Close
set adoconn=nothing
Response.End
end if
response.redirect"show.asp"
end if
%>
用iis浏览时,出现提示:set rs=adoconn.execute(sql)有错误。我确定数据库连接没问题,sql语句没问题。这种情况不止遇到了一次,别的同学也碰到过,就是瞎改,不知道怎么就能正确运行了。希望高手指点一下,多谢了。
问题2
rs.open sql,conn,1,1
总是提示这一行有问题。实在不明白,整个程序不运行,着急上火呀。