急需请教:数据库读取错误

winson_d 2003-08-26 09:00:33
读取有时可以有时不行,是什么原因?请教!!!

错误类型:
Provider (0x80004005)
未指定的错误
/password.asp, 第 7 行

有问题的代码如下:

<%
Function checkpassword( ID, Pwd )
Dim conn, SQLstr, rs

Set conn = Server.CreateObject("ADODB.Connection")
SQLstr = "driver={Microsoft Access Driver (*.mdb)};Pwd=ding"
conn.Open SQLstr & ";dbq=" & Server.MapPath("users.mdb")

sql = "Select * From users Where ID='" & ID & "' And Pwd = '" & Pwd & "'"
Set rs = conn.Execute( sql )
If rs.EOF Then
checkpassword = False
Else
checkpassword = True
End If
End Function
%>
...全文
65 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
pp4u 2003-08-26
  • 打赏
  • 举报
回复
如果是有时可以有时不行,那就大多数不是设计上的毛病,看看你的数据库设置有没有问题?
xiaobird1 2003-08-26
  • 打赏
  • 举报
回复
ID是什么类型?
如果是数值型:
sql = "Select * From users Where ID=" & ID & " And Pwd = '" & Pwd & "'"

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧