出错页代码:
=========================================================================
<!-- #include file= "conn.asp " -->
<% dim picid,piclb
picid=request( "p ")
piclb=request( "lb ")
%>
<table width= "98% " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td> </td>
</tr>
<%
dim sql,rs '问题好像就出在这里,lb直接输入参数却没事
sql= "select * from img where lb= '&piclb& ' order by id desc "
set rs=cn.execute(sql)
j=1 '控制行数,或着你用取出的记录总数除3 做为行数
do while j <=40
j=j+1
%>
<tr align= "center " bgcolor= "#ffffff ">
<%
k=1
do while k <=2 and not(rs.bof or rs.eof) 'k是控制列数
k=k+1
%>
<td> <img src= "upload\ <%=rs( "src ")%> " width= "70 " height= "70 " border= "0 " /> </td>
<%
rs.movenext
loop
%>
</tr>
<%loop%>
<tr>
<td> <%=rs( "id ")%> </td>
</tr>
</table>
=========================================================================
错误提示:
=========================================================================
错误类型:
ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/uploadpic/smphoto.asp
=========================================================================
总是遇到些很意外的错误
请各位有经验的帮下忙,
------解决方案--------------------
do while k <=2 and not(rs.bof or rs.eof) 改为do while k <=2 and not(rs.bof and rs.eof)
------解决方案--------------------
另外去掉 <%=rs( "id ")%> ,要么你把它放在do while k <=2 and not(rs.bof and rs.eof) 这层循环内。因为这个时候记录集引用不存在。
------解决方案--------------------
where lb= ' "&piclb& " '
------解决方案--------------------
piclb 变量如果是字符串需要加引号,如是true 或false 可不用