还是关于access导入sql的问题
怎么总是说用户名或密码错误哩~~`
这个是指什么的用户名和密码啊
还请高手赐教
[此贴子已经被作者于2006-3-17 17:13:14编辑过]
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<%dim username,userpassword,comeurl
username=replace(trim(request("username")),"'","")
userpassword=md5(replace(trim(request("userpassword")),"'",""))
if username="" or userpassword="" then
response.write "<script LANGUAGE='javascript'>alert('对不起!您的用户名或密码有误!');history.go(-1);</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from [user] where username='"&username&"' and userpassword='"&userpassword&"' " ,conn,1,3
if not(rs.bof and rs.eof) then
if userpassword=rs("userpassword") then
response.Cookies("songxf")("username")=trim(request("username"))
response.Cookies("songxf")("reglx")=rs("reglx")
response.Cookies("songxf")("jiaoyijine")=rs("jiaoyijine")
Response.Cookies("aspsky")("username") = rs("username")
Response.Cookies("aspsky")("password") = rs("userpassword")
Response.Cookies("aspsky")("userclass") = rs("userclass")
Response.Cookies("aspsky")("userid") =rs("userid")
Response.Cookies("aspsky")("userhidden") = 2
Response.Cookies("aspsky").path="/shop/shop/bbs/"
Response.Cookies("aspsky")("usercookies") = 1
Response.Cookies("aspsky").Expires=Date+1
rs("lastlogin")=now()
rs("logins")=rs("logins")+1
rs("userlastip")=Request.ServerVariables("REMOTE_ADDR")
rs.Update
rs.Close
set rs=nothing
username=trim(request("username"))
conn.execute("delete from shop_action where username='"&username&"' and zhuangtai=7")
conn.execute("delete from shop_action_jp where username='"&username&"' and zhuangtai=7")
if request("linkaddress")="" then
response.redirect request.servervariables("http_referer")
else
response.redirect request("linkaddress")
end if
else
response.write "<script LANGUAGE='javascript'>alert('对不起,您的用户名或密码有误!');history.go(-1);</script>"
end if
else
response.write "<script LANGUAGE='javascript'>alert('对不起!您的用户名或密码有误!');history.go(-1);</script>"
end if
'sub loginok()
'response.Write "<font size=2>欢迎您 <font color=red size=2>"&request.Cookies("bookshop")("username")&"</font>,两秒种后将自动跳转到相应页!</font>"
'response.redirect "index.asp"
'end sub
%>
上面是检验用户名和密码的,可是,我输入用户名和密码以后老出现“对不起!你的用户名或密码有错误!”
再帮我看一下conn.asp
<%
dim conn,connstr
set conn=server.createobject("adodb.connection")
connstr="Driver={SQL Server};server=J92;uid=sa;pwd=;database=shibang"
conn.Open connstr
%> 上面的程序有错么
上面是用户登陆注册的一小部分