想不到我也碰到了access数据库链接错误!帮我

hmbory 2001-11-28 03:29:05
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%dim name,password,conn,rs
name=trim(request("textfield"))
password=trim(request("textfield2"))
if name="" or password="" then
Response.Redirect "sorry.asp?id=对不起!请输入用户名及密码!"
end if
set Conn=server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath(".\strongsoft.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" &DBPath&";"
set rs=server.CreateObject("adodb.recordset")
sql="select * from user where name='"&name&"'"
rs.Open sql,conn,3,3
if rs.EOF then
Response.Redirect "sorry.asp?id=对不起!没有此用户,请先注册!"
end if
if trim(rs("password"))<>password then
Response.Redirect "sorry.asp?id=对不起!密码错误!"
else
session("name")=name
session("password")=password
session("id")=trim(rs("id"))
set rs=nothing
set conn=nothing
Response.Redirect "co.htm"
end if
%>
</BODY>
</HTML>
第一次登录好好的!第二次登录时就提示
错误类型:
Provider (0x80004005)
/strong/check.asp, 第 15 行
我搞了一天了。还是不知道错在哪里
...全文
537 40 打赏 收藏 转发到动态 举报
写回复
用AI写文章
40 条回复
切换为时间正序
请发表友善的回复…
发表回复
hmbory 2001-11-30
  • 打赏
  • 举报
回复
可是我写成mappath(xxx)时,也提示错误!!无耐才这样子的!!!
不过己经解决了!!!
可爱的排骨 2001-11-30
  • 打赏
  • 举报
回复
ACCESS97与2000一起用时你会觉得更烦!
PS:.mappath(./XXX) 可以直接写成 .mappath(xxx), 那个"./"和".\"多余
hmbory 2001-11-29
  • 打赏
  • 举报
回复
己经可以设为写入权限了!但还是不行呀!!!
tripofdream 2001-11-29
  • 打赏
  • 举报
回复
你的第二个问题是使用ACCESS数据库经常会碰到的权限问题,在IIS中打开ACCESS文件所在目录的写入权限(如果此目录下仅有ACCESS文件,同时可以去掉此目录的读取权限,以防数据库被下载);如果所在磁盘分区是NTFS格式的,还要在资源管理器中设置文件的系统文件安全属性.
hmbory 2001-11-29
  • 打赏
  • 举报
回复
to 风:提示0x800A0CB3错误。我查了一下是“提供者不支持应用程序请求的操作。”

还真难搞定!!
hmbory 2001-11-29
  • 打赏
  • 举报
回复
to zxch09:试过了。不行呀
hammer1025 2001-11-29
  • 打赏
  • 举报
回复
试一试 rs.Open sql,conn,3,3,1
在 rs("name")=username
rs("password")=password
前输出username和password看看
zxch09 2001-11-29
  • 打赏
  • 举报
回复


sql="UPDATE user set name='" &username& "',password='" &password&"' where ID='" & ID & "'"
conn.execute sql
hmbory 2001-11-29
  • 打赏
  • 举报
回复
运行了!!没错呀!!可是还是update错误呀!!
hammer1025 2001-11-29
  • 打赏
  • 举报
回复
在sql = "select * from user where [id]='"+session("id")+"'"后加上
response.write sql
看一看sql 的值在access中运行一下
hmbory 2001-11-29
  • 打赏
  • 举报
回复
到底是哪里错了呢???
hmbory 2001-11-29
  • 打赏
  • 举报
回复
解决了
sql="update user set name='"&username&"',password='"&password&"' where id='"&session("id")&"'"
conn.Execute sql
在自己机子不行。放到网上可以!!!
谢谢各位了
hmbory 2001-11-29
  • 打赏
  • 举报
回复
我是用administrator登录的!!!
julyclyde 2001-11-29
  • 打赏
  • 举报
回复
要NTFS的读、写权,不是IIS的虚拟目录权限
hmbory 2001-11-28
  • 打赏
  • 举报
回复
不是那个原因!!在上面我己经去空格了!!!
hmbory 2001-11-28
  • 打赏
  • 举报
回复
strongsoft数据库有两张表user和code表!!!
user表中有三个字段name,password,id
code有二个字段id,idname
全为文本,长为20
hammer1025 2001-11-28
  • 打赏
  • 举报
回复
用下面的试一试
rs("name")=rtrim(username)
rs("password")=rtrim(password)
hammer1025 2001-11-28
  • 打赏
  • 举报
回复
你的数据库结构,字段类型!
hmbory 2001-11-28
  • 打赏
  • 举报
回复
谁有搞过的。请指点迷津!
hmbory 2001-11-28
  • 打赏
  • 举报
回复
我搞得都是sqlserver!想不到access这么难伺候!!!
加载更多回复(20)

28,408

社区成员

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

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