ADODB.Field (0x80020009)这是怎么一回事
错误类型:ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/admin/finlist.asp
程序代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!--#include file="../Connections/conn.asp" --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.> <html xmlns="http://www.> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <style type="text/css"> <!-- .STYLE1 { font-size: 36px; font-weight: bold; } --> </style> </head> <body> <table width="600" border="0" cellpadding="5" cellspacing="0" bordercolor="#E8E09F" align="center" > <tr> <td colspan="3" align="center" nowrap="nowrap" bgcolor="#F3EFCD" class="STYLE7"><span class="STYLE1">详单</span></td> </tr> <tr> <%cx = request("id") sql = "select * from pay where author like '%"&cx& "%' order by id desc" set rs=server.createobject("adodb.recordset")' rs.open sql,conn,1,1 %> <%if rs.bof then response.write "<td align='center'><strong>对不起!没有相关的记录</strong></td>" response.end end if %> <td colspan="1" nowrap="nowrap" bgcolor="#F3EFCD" class="STYLE7 " align="left"><strong>客户名称:<%=rs("user")%></strong></td> <td nowrap="nowrap" bgcolor="#F3EFCD" colspan="1" class="STYLE7 " align="center"><strong> 电话:</strong></td> <td nowrap="nowrap" bgcolor="#F3EFCD" colspan="1" class="STYLE7 " align="right"><strong>NO. <%=rs("no")%></strong></td> </tr> </table> <table width="600" border="1" cellpadding="5" cellspacing="0" bordercolor="#E8E09F" id="detailItem" align="center" > <tr> <td nowrap="nowrap" bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>商品名称</strong></td> <td nowrap="nowrap" bgcolor="#F3EFCD" class="td1 STYLE7" align="center"><strong>规 格</strong></td> <td nowrap="nowrap" bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>单位</strong></td> <td nowrap="nowrap" bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>数量</strong></td> <td nowrap="nowrap" bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>单价</strong></td> <td nowrap="nowrap" bgcolor="#F3EFCD" class="STYLE7 td1" align="center"><strong>金额</strong></td> </tr> <% sum1=0 '总金额初始值=0 WHILE NOT RS.EOF %> <tr > <td nowrap="nowrap" bgcolor="#F3EFCD" align="center"><%=rs("name")%></td> <td nowrap="nowrap" bgcolor="#F3EFCD" align="center"><%=rs("size")%></td> <td nowrap="nowrap" bgcolor="#F3EFCD" align="center"><%unit=rs("unit") response.write(unit)%></td> <td nowrap="nowrap" bgcolor="#F3EFCD" align="center"><%quantity=rs("quantity") response.write(quantity)%></td> <td nowrap="nowrap" bgcolor="#F3EFCD" align="center"><%pric=rs("pric") sum=pric*quantity sum1=sum1+sum response.write(pric) %></td> <td nowrap="nowrap" bgcolor="#F3EFCD" align="center"><% response.write(sum)%></td> </tr> <%RS.MoveNext WEND%> </table> <table width="600" border="1" cellpadding="5" cellspacing="0" bordercolor="#E8E09F" id="detailItem" align="center" > <tr> <% dim a '要转换成大写的金额 dim atoc '转换之后的值 Dim String1 '如下定义 Dim String2 '如下定义 Dim String3 '从原A值中取出的值 Dim I '循环变量 Dim J 'A的值乘以100的字符串长度 Dim Ch1 '数字的汉语读法 Dim Ch2 '数字位的汉字读法 Dim nZero '用来计算连续的零值是几个 a=sum1 String1 = "零壹贰叁肆伍陆柒捌玖" String2 = "万仟佰拾亿仟佰拾万仟佰拾元角分" nZero = 0 If InStr(1, CStr(a * 100), ".") <> 0 Then err.Raise 5000, , "此函数( AtoC() )只能转换小数点后有两位以内的数!" End If J = Len(CStr(a * 100)) String2 = Right(String2, J) '取出对应位数的STRING2的值 For I = 1 To J String3 = Mid(a * 100, I, 1) '取出需转换的某一位的值 If I <>(J - 3) + 1 And I <> (J - 7) + 1And I <> (J - 11) + 1 And I <>(J - 15) + 1 Then If String3 = 0 Then Ch1 = "" Ch2 = "" nZero = nZero + 1 ElseIf String3 <> 0 And nZero <> 0 Then Ch1 = "零" & Mid(String1, clng(String3) + 1, 1) Ch2 = Mid(String2, I, 1) nZero = 0 Else Ch1 = Mid(String1, clng(String3) + 1, 1) Ch2 = Mid(String2, I, 1) nZero = 0 End If Else '该位是万亿,亿,万,元位等关键位 If String3 <> 0 And nZero <> 0 Then Ch1 = "零" & Mid(String1, clng(String3) + 1, 1) Ch2 = Mid(String2, I, 1) nZero = 0 ElseIf String3 <> 0 And nZero = 0 Then Ch1 = Mid(String1, clng(String3) + 1, 1) Ch2 = Mid(String2, I, 1) nZero = 0 ElseIf String3 = 0 And nZero >= 3 Then Ch1 = "" Ch2 = "" nZero = nZero + 1 Else Ch1 = "" Ch2 = Mid(String2, I, 1) nZero = nZero + 1 End If If I=(J -11)+1Or I = (J - 3) + 1 Then '如果该位是亿位或元位,则必须写上 Ch2 = Mid(String2, I, 1) End If End If AtoC = AtoC & Ch1 & Ch2 If I = J And String3 = 0 Then '最后一位(分)为0时,加上“整” AtoC = AtoC & "整" End If Next if a=0 then atoc="零元整" end if %> <td width="90" align="center" nowrap="nowrap" bgcolor="#F3EFCD" class="STYLE7 "><strong>合计大写:</strong></td> <td width="360" align="center" nowrap="nowrap" bgcolor="#F3EFCD" class="STYLE7 "><%=atoc%> </td> <td width="120" align="left" nowrap="nowrap" bgcolor="#F3EFCD" class="STYLE7 "><span class="admintitle"><strong>¥</strong></span>:<%=sum1%></td> </tr> </table> <table width="600" border="0" cellpadding="5" cellspacing="0" bordercolor="#E8E09F" id="detailItem" align="center" > <tr> <td nowrap="nowrap" bgcolor="#F3EFCD" class="STYLE7"><strong>制单人: <%response.write(rs("jidan"))%> </strong></td> </tr> </table> </body> </html>