我这里有段代码,连接SQL就老是提示密码不正确,但连接到ACCESS就一切正常啦~~请问这是什么问题呀?是SQL问题吗?那为什么用户名又能通过,而且我一个朋友用也是这样的一个错误,以下代码: <!--#include file="odbc_conn.asp"-->
<% dim username,userpwd,userip,sql,rs userip=request.ServerVariables("REMOTE_ADDR") username=trim(replace(request.form("username"),"'","")) userpwd=trim(request.form("pwd")) if username="" then %> <Script language="JavaScript"> alert("用户不能为空"); location.href="javascript:history.back()" </Script> <% end if if userpwd="" then%> <Script language="JavaScript"> alert("错误:请输入密码!"); location.href="JavaScript:history.back()" </Script> <%end if%> <% if request.form("shenfen")="zc1" then sql="select * from zc1 where userid='"&username&"'" else sql="select * from zc2 where userid='"&username&"'" end if set rs=Server.CreateObject("ADODB.Recordset") rs.open sql,db,1,3 %>
<%if rs.bof and rs.eof then%> <Script language="JavaScript"> alert("此用户名不存在"); location.href="javascript:history.back()" </Script> <%end if%> <%if userpwd=rs("userpwd") then%>
<%set rs=server.createobject("ADODB.Recordset")
rs.open sql,db,1,3 session("userid")=rs("userid")
session("userpwd")=rs("userpwd")
rs.close set rs=nothing%> <Script language="JavaScript"> alert("您已成功登录管理页面"); location.href="index.asp" </Script>
<%else%> <script language="javascript"> alert("您的密码不正确"); location.href="javascript:history.back()" </script>
<%end if%>
各位来帮帮我