SQL数据库链接问题
源码如下:<!-- #include file="Conn/Conn.asp" -->
<%
Session.Timeout=30
dim name,pass,rst,sql
name=request.form("username")
pass=request.form("PWD")
if request.QueryString("act")="login" then
set rst=server.CreateObject("adodb.recordset")
sql="select u_admin,u_psw,u_upid,u_name,u_id from user where u_admin='"&name&"' and u_psw='"&pass&"'"
rst.open sql,conn,1,1
if not rst.eof then
session("login")="yes"
session("id")=rst("u_id")
session("name")=rst("u_name")
session("bumen")=rst("u_upid")
response.write "<script language=JavaScript>alert('登陆成功!');"&"window.location.href = 'default.asp' </script>"
else
response.write "<script language=JavaScript>alert('用户名或密码错!');"&"window.location.href = 'login.asp'</script>"
response.end
rst.close
set rst=nothing
set conn=nothing
end if
end if
%>
显示错误为:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC 驱动程序不支持所需的属性。
/shopshow/checklogin.asp, 第 10 行
就是这段 sql="select u_admin,u_psw,u_upid,u_name,u_id from user where u_admin='"&name&"' and u_psw='"&pass&"'"
conn.asp文件:
dim conn
set conn=server.CreateObject("adodb.connection")
conn.open="Driver={SQL Server};Server=(local);uid=sa;pwd=121793;Database=shopshow"
当我用ASSESS数据库时运行起来完全正确
当换成SQL2005 时运行起来就出现了上面的错误