+ -
当前位置:首页 → 问答吧 → 请教数据库连接问题

请教数据库连接问题

时间:2010-09-03

来源:互联网

大家好,我是新手,刚开始学ASP,制作网页中出现以下问题,请问如何解决?

-----------------以下是代码:

body {
       margin-left: 0px;
       margin-top: 0px;
}
td {
       font-family: "黑体";
       font-size: 14px;
       color: #000033;
}
-->
</style>
</head>
<body>
<!--#include file="include/top.htm"-->
<!--#include file="include/conn.asp"-->
<%
dim user,password,sql
user=request.Form("user")
password=request.Form("password")
if user<>"" and password<>"" then  
sql="select * from user where user='" &user& "' abd pword='" &password& "'"
rs.open sql,conn,1,1
if not re.eof then
  response.Redirect("index1.asp")
else
%>
<script>
alert("您输入的用户名或密码不正确!")
location.href="admin.asp"
</script>
<%
end if
else
%>

----------------------------------在IIS中预览告之以下错误:

技术信息(用于支持人员)

错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC 驱动程序不支持所需的属性。
/admin.asp, 第 30 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; SE 2.X)

网页:
POST 30 ??? /admin.asp

----------------------表示第30行有错,我的第30行是:
rs.open sql,conn,1,1


----------------------使用的MS  access数据库:

请问我该怎么改?

非常感谢!

作者: highbug   发布时间: 2010-09-03

复制内容到剪贴板
代码:
sql="select * from user where user='" &user& "' abd pword='" &password& "'"
中的abd是什么意思?

作者: bqh324   发布时间: 2010-09-04

引用:
原帖由 bqh324 于 2010-9-4 08:07 发表
sql="select * from user where user='" &user& "' abd pword='" &password& "'"
中的abd是什么意思?
---非常抱歉,应该是"and"。  谢谢 !

[ 本帖最后由 highbug 于 2010-9-4 09:34 编辑 ]

作者: highbug   发布时间: 2010-09-04

相关阅读 更多