E
Emond
Unregistered / Unconfirmed
GUEST, unregistred user!
我在自己的电脑上写了一个发邮件的asp程序,windows2000 Server+iis+ie,
以近调试成功,按倡导主页上就出错。不知为什么,问题应初在数据库连接上。
我在多个主页都试了不行。下面用户登录的源代码,请各位指点:
<%
uname=request.form("textuser")
uemail=request.form("textemail")
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("/")&"/data/mydb.mdb"
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" &
DBPath
Set rs1 = Server.CreateObject("ADODB.Recordset")
success=0
sql1="select * from mydb where name='"&uname&"'and email='"&uemail&"'"
rs1.open sql1,conn,3,3
if not rs1.eof then
success=1
session("user")=rs1("name")
session("useremail")=rs1("email")
rs1.close
response.redirect "top.asp?login=true"
end if
if success=0 then
rs1.close
response.redirect "top.asp?login=false"
end if
%>
以近调试成功,按倡导主页上就出错。不知为什么,问题应初在数据库连接上。
我在多个主页都试了不行。下面用户登录的源代码,请各位指点:
<%
uname=request.form("textuser")
uemail=request.form("textemail")
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("/")&"/data/mydb.mdb"
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" &
DBPath
Set rs1 = Server.CreateObject("ADODB.Recordset")
success=0
sql1="select * from mydb where name='"&uname&"'and email='"&uemail&"'"
rs1.open sql1,conn,3,3
if not rs1.eof then
success=1
session("user")=rs1("name")
session("useremail")=rs1("email")
rs1.close
response.redirect "top.asp?login=true"
end if
if success=0 then
rs1.close
response.redirect "top.asp?login=false"
end if
%>