劳驾哪位高人给小女子指点一下
在从登录界面转向主界面时出错,请问是连接数据库时的问题吗?
下面是错误信息及原代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
set conn=server.CreateObject("adodb.connection")
conn.open"driver={sql server};server=(local);UID=sa;PWD=;database=Mydb"
%>
<%if isempty(request.Form("login"))then
session.Abandon
session("NumAttemp")=1
TheMessage="请在本系统下登录"
else
set conn=server.CreateObject("adodb.connection")
conn.open"driver={sql server};server=(local);UID=sa;PWD=;database=Mydb"
TheUsername=Request.Form("Username")
ThePassword=Request.Form("Password")
if Instr(TheUsername,"'")=0 and Instr(ThePassword,"'")=0 and Instr(TheUsername,"'")=0 and Instr(ThePassword,"'")=0 then
set RSLogin=conn.Execute("select* from UserInfo (提示错)where"&"LoginID='"&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("LoginID")
Application("ID")=RSLogin("LoginID")
Session("Name")=RSLogin("Name")
Session("Password")=RSLogin("Password")
Session("Deparment")=RSLogin("Department")
Session("EmailAddress")=RSLogin("EmailAddress")
Session("Position")=RSLogin("Position")
Session("InternalPhone")=RSLogin("InternalPhone")
Session("Homephone")=RSLogin("Homephone")
Session("MobilePhone")=RSLogin("MobilePhone")
Session("QQ")=RSLogin("QQ")
Session("Birthday")=RSLogin("Birthday")
Session("HomeAddress")=RSLogin("HomeAddress")
Session("IsSystemManager")=RSLogin("IsSystemManager")
Session("IsFinancialManager")=RSLogin("IsFinancialManager")
Response.Redirect"home.asp"
end if
else
TheMessage="用户名或者密码输入不符合格式"
end if
end if
%>