错。odbc连接不是ado连接
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body>
<%
uname=Request.form("name")
upwd=request.form("pwd")
nowtime=now() 'now()含日期
uip=request.servervariables("remote_host")
''''''''''''''''''''''建立ado连接
set conn=server.createobject("adodb.connection")
dsnstr="dsn=bbsdb;uid=sa"
conn.open dsnstr
set rs=server.createobject("adodb.recordset")
sqlstr="select * from users where name='"&uname&"'and pwd='"&upwd&"'"
rs.open sqlstr,conn,3,2
if rs.eof then
session("loginflag")=false
rs.Close
set rs=nothing
responese.redirect "loginfalse.htm"
else
logins=rs("logins")
session("loginflag")=true
session("name")=uname
session("ip")=uip
rs("lasttime")=nowtime
rs("lastip")=uip
rs("logins")=logins+1
rs.Update
rs.Close
set rs=nothing
response.redirect "more.asp"
end if
%>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body>
<%
uname=Request.form("name")
upwd=request.form("pwd")
nowtime=now() 'now()含日期
uip=request.servervariables("remote_host")
''''''''''''''''''''''建立ado连接
set conn=server.createobject("adodb.connection")
dsnstr="dsn=bbsdb;uid=sa"
conn.open dsnstr
set rs=server.createobject("adodb.recordset")
sqlstr="select * from users where name='"&uname&"'and pwd='"&upwd&"'"
rs.open sqlstr,conn,3,2
if rs.eof then
session("loginflag")=false
rs.Close
set rs=nothing
responese.redirect "loginfalse.htm"
else
logins=rs("logins")
session("loginflag")=true
session("name")=uname
session("ip")=uip
rs("lasttime")=nowtime
rs("lastip")=uip
rs("logins")=logins+1
rs.Update
rs.Close
set rs=nothing
response.redirect "more.asp"
end if
%>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货