请大家帮忙看一下这个程序,谢谢了!
<%@ Language=VBScript %>
<%
'判断用户是否提交表单
if isempty(Request.Form("Login")) then
Session.abandon
Session("NumAttempts") = 1
TheMessage = "请在下面登录:"
'校验用户提交的用户信息
else
set conn = server.createobject ("adodb.connection")
conn.open "driver={Microsoft Access Driver(*.mdb)};dbq="&Server.Mappath("asp.m
db")
TheUsername=Request.Form("Username")
ThePassword=Request.Form("Password")
If Instr(TheUsername, "'")=0 and Instr(ThePassword, "'")=0 and Instr(TheUserna
me, "'")=0 _
and Instr(ThePassword, "'")=0 then
set RSLogin = conn.Execute("select * from Login where " & "ID = '" _
& TheUsername & "' and " & "Password = '" & ThePassword & "'")
if RSLogin.EOF then
Session("NumAttempts") = Session("NumAttempts") + 1
if Application("NumAttempts") = 0 then
TheMessage = "登录不成功,请重试:"
elseif Session("NumAttempts") > Application("NumAttempts") then
TheMessage = "登录不成功,登录次数已满,无法重试"
else
TheTimes=Application("NumAttempts")-Session("NumAttempts")+1
TheMessage = "登录不成功,还有" & TheTimes & "次机会,请重试:"
end if
else
Session("ID") = RSLogin("ID")
Application("ID") = RSLogin("ID")
Session("Name") = RSLogin("Name")
Session("Password") = RSLogin("Password")
Session("Department") = RSLogin("Department")
Session("Position")=RSLogin("Position")
Session("sex")=RSLogin("sex")
Session("HomePhone")=RSLogin("HomePhone")
Session("MobilePhone")=RSLogin("MobilePhone")
Session("authority")=RSLogin("authority")
Response.Redirect "./html/home.asp"
end if
else
TheMessage="用户名或者密码输入不合格式"
end if
end if
%>
<html>
<head>
<title> 系统登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=ce
nter>
<tr bgcolor=white><td valign=center ><img src="../ASPLogo3.jpg" width=796 h
eight=100></td></tr>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding
="0" cellspacing="0">
<tr><td height="13"><img src=".././image/banner2.jpg" width="800" height="12">
</td></tr>
</table>
<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=ce
nter>
<tr><td colspan=3>
<font color=white>
<P ALIGN="CENTER">公司内部办公信息管理系统->登录页面</font></td></tr>
<tr bgcolor=white >
<td><a href=".././html/home.asp"><font color="#104DAD">返回上一站点</font></a>
</td>
<td align=center> <font color="#104DAD" ><% response.write TheMessage %></FON
T></td>
</tr>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding
="0" cellspacing="0">
<tr><td height="13"><img src=".././image/banner2.jpg" width="800" height="12">
</td></tr>
</table>
<br>
<table width=800 border="0" align=center bgcolor=#3466BB height=350>
<tr bgcolor=white>
<td align=middle bgcolor=#B6CAEB class=itm height="8" colspan="2">
<br> <% response.write TheMessage %>
<div align="center">
<%
if TheMessage <> "登录不成功,登录次数已满,无法重试" then
%>
<form name="form" method="post" action="login.asp">
<p><font color="#3466BB">用户</font>
<input class=itm name=UserName size=15>
</p>
<p><font color="#3466BB">口令</font>
<input class=itm name=Password size=15 type=password>
<br>
<br>
<input type="submit" name="Login" value="登录" style="border: 1px solid #B6CAE
B; background-color: #3466BB; color: #FFFFFF">
<input type="reset" name="Reset" value="重设" style="border: 1px solid #B6CAEB
; background-color: #3466BB; color: #FFFFFF">
</p>
</form>
<%
end if
%>
</div></td>
</tr>
</table>
</body>
</html>
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
/bishe/新建文件夹/login.asp, 第 11 行
可是这样一个程序我查了好几天了却一直提示数据库连接方面出了问题,请问有人可以帮
忙看一看吗?谢了