谁能帮我解决一个关于ASP代码的问题?重谢

来源:百度知道 编辑:UC知道 时间:2024/06/07 06:49:45
我用ASP做了一个在线考试系统,这是用户登陆后出现的问题,提示set rs=conn.execute(str)错误,请问这是怎么回事?请详细些!————

<!--#include file="open.asp" -->
<!--#include file="inc/md5.inc" -->
<%path_name=request.servervariables("SCRIPT_NAME")
strnum=len(path_name)-instrrev(path_name,"/")
self_name=right(path_name,strnum)%>
<%
doing=request.querystring("doing")
if doing="login" then '用户登录
user_id=trim(request.form("user_id"))
pass=trim(request.form("pass"))
if user_id<>"" and pass<>"" and instr(user_id,"'")=0 and instr(user_id,"&")=0 then
pass=ucase(md5(pass))
str="select * from user_teacher where teacher_user='"&user_id&"' and teacher_pass='"&pass&"'"
set rs=conn.execute(str)
if not rs.eof then
sessi

查询语句(select)会返回数据集,一定要用open命令即把set rs=conn.execute(str) 替换成rs.open str,conn,1,1

str重名没关系

你有三个set rs=conn.execute(str),把str改名,如str1,str2,不要有重复的