asp连接数据库sql2005的问题~??
这是我的一个网页,前面是一个登陆网页,点了登陆,就经过这个asp连接数据库验证~就是一个登陆的意思~但是我为什么老是得不出我理想的结果~运行结果就是:跳到这个“欢迎使用5...
这是我的一个网页,前面是一个登陆网页,点了登陆,就经过这个asp连接数据库验证~就是一个登陆的意思~但是我为什么老是得不出我理想的结果~运行结果就是:跳到这个“欢迎使用56”的网页~但是什么都没有!空白,也没有任何提示!
我的数据库用户名和密码肯定没有问题!sql2005也开着~请各位指教~是不是在语言方面有问题?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>欢 迎 使 用56</title>
</head>
<body>
<%
dim connstr,conn,yhm,mm,a,b
yhm=request("yhm")
mm=request("mm")
response.write ("用户名输入错误")
connstr="Driver={SQL Server};server=127.0.0.1;database=dlxt;uid=yuran;pwd=123;"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connstr
Set rs= Server.CreateObject("ADODB.RecordSet")
SQL="Select yhm From users where yhm='"&yhm& "'"
Rs.open sql,conn,1,3
if not rs.eof then
a=1
else
response.write ("用户名输入错误")
end if
SQL="Select yhm From users where pwd='"&mm& "'"
Rs.open sql,conn,1,3
if not rs.eof then
b=1
else
response.write( "密码输入错误")
end if
if a=1 and b=1 then
response.write("谢谢登陆")
end if
rs.close
%>
</body>
</html>
另外,我想在最后通过验证后跳转到一个另外一个网页~请问应该在最后怎么改一下?? 展开
我的数据库用户名和密码肯定没有问题!sql2005也开着~请各位指教~是不是在语言方面有问题?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>欢 迎 使 用56</title>
</head>
<body>
<%
dim connstr,conn,yhm,mm,a,b
yhm=request("yhm")
mm=request("mm")
response.write ("用户名输入错误")
connstr="Driver={SQL Server};server=127.0.0.1;database=dlxt;uid=yuran;pwd=123;"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connstr
Set rs= Server.CreateObject("ADODB.RecordSet")
SQL="Select yhm From users where yhm='"&yhm& "'"
Rs.open sql,conn,1,3
if not rs.eof then
a=1
else
response.write ("用户名输入错误")
end if
SQL="Select yhm From users where pwd='"&mm& "'"
Rs.open sql,conn,1,3
if not rs.eof then
b=1
else
response.write( "密码输入错误")
end if
if a=1 and b=1 then
response.write("谢谢登陆")
end if
rs.close
%>
</body>
</html>
另外,我想在最后通过验证后跳转到一个另外一个网页~请问应该在最后怎么改一下?? 展开
1个回答
展开全部
下面第一行错了个符号
dim connstr,conn,yhm,mm,a,b
yhm=request("yhm")
mm=request("mm")
response.write ("用户名输入错误")
dim connstr,conn,yhm,mm,a,b
yhm=request("yhm")
mm=request("mm")
response.write ("用户名输入错误")
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询