![]() |
#2
了无痕2007-10-23 10:09
|
贴出下列相关代码,供大家参考问题:我用response输出结果发现conn.errors.count=1,去掉这个if条件,下面的n值却为空。
on error resume next
user_id=trim(request.form("user_id"))
user_pwd=trim(request.form("user_pwd"))
dsnstr="dsn=kf;UID=sa;pwd=huangxk;"
set conn=server.createobject("adodb.connection")
conn.open dsnstr
sqlstr1="SELECT USERID,USERPASS from WEB_LOGON_USERS where (USERID='"&user_id&"')and (USERPASS='"&user_pwd&"')"
conn.execute sqlstr1
if conn.errors.count>0 then
msgbox("nihao")
else
set rs=server.createobject("adodb.recordset")
sqlstr="SELECT USERID,USERPASS from WEB_LOGON_USERS where (USERID='"&user_id&"')and (USERPASS='"&user_pwd&"')"
rs.open sqlstr,dsnstr,3,1
n=rs.recordcount
[此贴子已经被作者于2007-10-23 10:33:00编辑过]