我的这个asp怎么错了

来源:百度知道 编辑:UC知道 时间:2024/05/16 15:40:52
技术信息(用于支持人员)

错误类型:
ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/index.asp

浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MAXTHON 2.0)

网页:
GET /index.asp

时间:
2009年4月27日, 16:58:14

详细信息:
Microsoft 支持

我用的VBS文件里写的这些
sub rmwz()
response.write("123")
dim changdu,shuliang,vevecd
shuliang=-1
if rs(5)=true and rs(6)=true then
if rs(3)="热门网址" then
shuliang=shuliang+1
vevesj=rs(1)
vevecd=len(vevesj)
changdu=changdu+vevecd
while shuliang+changdu<3
response.write("<a href=")
response.write(rs(2))
response.write(" target=_blank>")
response.write(rs(1))
response.write("</a>")
rs.movenext
wend
end if
end if
end sub 我在asp文件里用ADODB.recordset连得数据库

vbs文件的编码里rs是数据

do while not rs.eof and cint(shuliang+changdu)<3
response.write("<a href=")
response.write(rs(2))
response.write(" target=_blank>")
response.write(rs(1))
response.write("</a>")
rs.movenext
loop

意思就是这个表里没有你的SQL的相关数据,假如你查询ID为1的数据,这表里没有ID为1的数据,就会提示一个为真...,有相关数据就完整显示了,你可以判断一下
if rs.eof and rs.bof then
response.write("暂无数据!")
else
输出的信息
end if

记录集是空的,你在用到数据库的时候先判断下读取到的记录是否为空。

你没有在 sub rmwz() 函数中,打开数据表..当然没记录..