数据库出现错误

zuida 2003-05-27 01:00:19
<%
id=Request.QueryString("id")
abc=Request.QueryString("abc")

set com=server.createobject("adodb.connection")
com.open "DBQ="& Server.MapPath("zhengwu.mdb") &";Driver={Microsoft Access Driver (*.mdb)}"
set rs=com.execute("select*from biao where id='&id&'" )
name=rs("name")
%>
<p><%=name%>
程序出现错误,我的数据库只有两条记录,三个字段,一个是id 、abc和name
错误提示如下:
ADODB.Field 错误 '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted; the operation requested by the application requires a current record.


...全文
27 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
zuida 2003-05-27
  • 打赏
  • 举报
回复
还是不行啊,错误是不出现了,但是光出现”没有这条记录“,我的数据库的ID类型是文本型的,可以从另一页传送过来,但是为什么没有这条记录呢,
zuida 2003-05-27
  • 打赏
  • 举报
回复
还是不行啊,错误是不出现了,但是光出现”没有这条记录“,我的数据库的ID类型是文本型的,可以从另一页传送过来,但是为什么没有这条记录呢,
intereye 2003-05-27
  • 打赏
  • 举报
回复
如果真是数据型就改成这样就OK了.
set rs=com.execute("select*from biao where id="&id&"" )

哦~~对了.你刚才那个就是字符型也书写错了.

错:set rs=com.execute("select*from biao where id='&id&'" )
对:set rs=com.execute("select*from biao where id='"&id&"'" )
andy2001p 2003-05-27
  • 打赏
  • 举报
回复
set rs=com.execute("select*from biao where id="&id)

ID是数值型的
intereye 2003-05-27
  • 打赏
  • 举报
回复
<%
id=Request.QueryString("id")
abc=Request.QueryString("abc")

set com=server.createobject("adodb.connection")
com.open "DBQ="& Server.MapPath("zhengwu.mdb") &";Driver={Microsoft Access Driver (*.mdb)}"
set rs=com.execute("select*from biao where id='&id&'" )
If rs.eof and rs.bof Then
Response.write "没有这条记录!"
Else
name=rs("name")
End If
%>
lqflsh 2003-05-27
  • 打赏
  • 举报
回复
set rs=com.execute("select * from biao where id='&id&'" )
改成这样看看。
zuida 2003-05-27
  • 打赏
  • 举报
回复
怎么可能不存在呢,这个id号是从另一页中得到的,目的是显示与这个id号相同的那条记录的别一个字段,怎么可能啊,到底是怎么回事呢
sun233 2003-05-27
  • 打赏
  • 举报
回复
要查询的ID号数据库中不存在。

28,391

社区成员

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

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