提问,在线等,急急急!!!!!(关于验证的!!!)
<%
connstr="DBQ="+server.mappath("database/myoa.mdb")+";driver={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
if request("username")="" and request("password")="" then
Session("Ulogin")="no"
Response.Redirect("login.asp?id=error")
session.abandon()
else
'----------------------------------------
uname=replace(trim(request("username")),"'","")
password=replace(trim(request("password")),"'","")
'------------------------------------------
Set rs= Server.CreateObject("ADODB.Recordset")
strsql="select * from tuser where loginname='"&uname&"' and loginpass='"&password&"'"
rs.open strsql,conn,1,3
if rs.eof then
Session("Ulogin")="no"
response.redirect "login.asp?id=error"
'-------------------------------------------------------
'IP= Request.ServerVariables("REMOTE_ADDR")
' nowtime=now()
' sj=cstr(year(nowtime))+"-"+cstr(month(nowtime))+"-"+cstr(day(nowtime))+" "+cstr(hour(nowtime))+":"+right("0"+cstr(minute(nowtime)),2)+":"+right("0"+cstr(second(nowtime)),2)
'shijian=cstr(year(nowtime))+right("0"+cstr(month(nowtime)),2)+right("0"+cstr(day(nowtime)),2)+right("0"+cstr(hour(nowtime)),2)+right("0"+cstr(minute(nowtime)),2)
'-----------------------------------------------------------
else
if rs("fshenhe")=false then
response.redirect "login.asp?id=pass"
end if
if uname<>rs("loginname") then
response.Redirect("login.asp?id=error")
end if
if upass <>rs("loginpass") then
response.Redirect("login.asp?id=error")
end if
'response.end
rs("forbid")=true
'rs("loginIP")=IP
'rs("Utime")=shijian
'rs("times")=rs("times")+1
rs.update
Session("Uid")=rs("id")
Session("Uname")=rs("loginname")
Session("Rname")=rs("realname")
Session("Upass")=rs("loginpass")
Session("depart")=rs("id_depart")
Session("quarter")=rs("id_quarters")
Session("Ulogin")="yes"
'application(session("isonline"))="T"
'----------------邮箱系统专用环境变量,请勿删除-------------------
Session("id")=rs("username")
Session("pwd")=rs("pwd")
Session("iPageSize")=rs("iPageSize")
Session("iAdd")=rs("iAdd")
Session("iBegin")=rs("iBegin")
Session("num")=0
'----------------邮箱系统专用环境变量,请勿删除-------------------
response.redirect("default.asp")
%>
<script language="JavaScript">
function tmt_fullscreen(url, scrollo) {
var larg_schermo = screen.availWidth - 10;
var altez_schermo = screen.availHeight - 75;
window.open(url, "", "width=" + larg_schermo + ",height=" + altez_schermo + ",top=0,left=0,menubar=yes,scrollbars=yes" );
}
</script>
<%
end if
end if
rs.Close
Conn.Close
set Conn = nothing
%>
__________________________________________________________________________
这老是报错
rs.open strsql,conn,1,3
_________________________________________________________________________
错误如下:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
/checklogin.asp, 第 18 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; i-NavFourF)
页:
POST 46 bytes to /checklogin.asp
POST 数据:
username=333&password=333&login.x=46&login.y=8