紧急求救!各位大侠帮忙啊!!!!!!!!!

lhl62301 2004-03-18 03:19:04
网页执行时的错误提示:
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

ADODB.Field 错误 '800a0bcd'

BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。

/view_r_user_index.asp,行7

网页的代码如下:
行7为 user_id= rs("id")
网页开头代码为
<!--#include file="conn.asp"-->
<%
dim rs,sql
sql= "select id,real_name,u_email,c_phone,c_fax,m_phone,c_postcode,c_city,c_address,c_name,c_type,pro_type,last_date from r_user where username='"&request("username")&"'"
set rs=conn.execute(sql)
username= request("username")
user_id= rs("id")
real_name= rs("real_name")
u_email= rs("u_email")
c_phone= rs("c_phone")
c_fax= rs("c_fax")
m_phone= rs("m_phone")
c_postcode= rs("c_postcode")
c_city= rs("c_city")
c_address= rs("c_address")
c_name= rs("c_name")
c_type= rs("c_type")
pro_type= rs("pro_type")
last_date= rs("last_date")
session("c_name")=c_name
rs.close
set rs=nothing
sql="select id,pro_name,pro_xh,pro_dj,pro_ad,pro_bag,pro_number,pro_price,pro_date from gong where username='"&username&"' order by ID desc"
set rsg=conn.execute(sql)
%>
分页显示的代码为
<%
page=request("page")
newpage=0
if page="" then page=1
do while newpage<page*6-6
newpage=newpage+1
rsg.movenext
loop
do while not rsg.eof
i=i+1
%>
<%if page=1 then %>
上一页
<%else%>
<a href="view_r_user_index.asp?page=<%=page-1%>"><font color="#0000FF">上一页</font></a>
<%end if%>
 
<%if i=6 and not rsg.eof then %>
<a href="view_r_user_index.asp?page=<%=page+1%>"><font color="#0000FF">下一页</font></a>
<%else%>
下一页
<%end if%>

在点击“下一页”时出现上面的错误提示
小弟改了半天,都改不对?请各位帮帮忙!!!!!!
...全文
51 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
lhl62301 2004-03-18
  • 打赏
  • 举报
回复
原来没有分页显示,我添加了分页显示的程序,点击下一页时才出现错误的??????????
cxj1976 2004-03-18
  • 打赏
  • 举报
回复
在数据库中没有读出数据来呀,应该先判断一下
if rs.eof and rs.bof then
lhl62301 2004-03-18
  • 打赏
  • 举报
回复
sql="select id,pro_name,pro_xh,pro_dj,pro_ad,pro_bag,pro_number,pro_price,pro_date from gong where username='"&username&"' order by ID desc"
set rsg=conn.execute(sql)

这不是创建了吗?
snowleaf 2004-03-18
  • 打赏
  • 举报
回复
数据记录为空啊,在此句之前,应加以判断

if rs.eof and rs.bof then '判断rs是否为空
'记录为空,处理
end if

此种错误都是因为RecordSet当前指针为空时,使用数据调用导致
lxxstarii 2004-03-18
  • 打赏
  • 举报
回复
不能用这个set rsg=conn.execute(sql)



rsg.open sql,conn,1,1
angelheavens 2004-03-18
  • 打赏
  • 举报
回复
'rsg没有创建,要创建

rsg.open sql,conn,1,1

28,391

社区成员

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

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