A
abbylee26
my page works fine if the db search finds at least one record that
satifies the query.
but if it does not find a match I get the following error message.
Error Type:
ADODB.Field (0x80020009)
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.
What do I need to change here to make this just display the page with
no data?
sSQL = "SELECT [Billing Date], [Service Number], [Subscriber User
Name]," & _
" Fund, Account,[Activity Code], Description, [Total Charge]" & _
" FROM 06_Statements" & _
" WHERE [Billing Date] = '" & Request.Form("cmonth") & "'" & _
" AND [Service Number] = '" & Request.Form("cnumb") & "'" & _
" AND cstr([Total Charge]) = '" & cstr(Request.Form("camount")) & "'"
set rs = Connect.Execute(sSQL)
<%
Do until rs.eof
%>
<tr>
<td><%=rs("Service Number")%></td>
<td><%=rs("Subscriber User Name")%></td>
<td><%=rs("Fund")%></td>
<td><%=rs("Account")%></td>
<td><%=rs("Activity Code")%></td>
<td><%=rs("Description")%></td>
<td><%=rs("Total Charge")%></td>
</tr>
<% End If
rs.MoveNext
Loop %>
satifies the query.
but if it does not find a match I get the following error message.
Error Type:
ADODB.Field (0x80020009)
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.
What do I need to change here to make this just display the page with
no data?
sSQL = "SELECT [Billing Date], [Service Number], [Subscriber User
Name]," & _
" Fund, Account,[Activity Code], Description, [Total Charge]" & _
" FROM 06_Statements" & _
" WHERE [Billing Date] = '" & Request.Form("cmonth") & "'" & _
" AND [Service Number] = '" & Request.Form("cnumb") & "'" & _
" AND cstr([Total Charge]) = '" & cstr(Request.Form("camount")) & "'"
set rs = Connect.Execute(sSQL)
<%
Do until rs.eof
%>
<tr>
<td><%=rs("Service Number")%></td>
<td><%=rs("Subscriber User Name")%></td>
<td><%=rs("Fund")%></td>
<td><%=rs("Account")%></td>
<td><%=rs("Activity Code")%></td>
<td><%=rs("Description")%></td>
<td><%=rs("Total Charge")%></td>
</tr>
<% End If
rs.MoveNext
Loop %>