Hi Andrew,
Quote:
quote:<% set rec=Server.CreateObject("ADODB.recordset") %>
<% strsql3 = "select Agency From TBLagency order by Agency;" %>
<% rec.Open strsql3, conn %>
agency
<% rec.movefirst %>
<% rs.movefirst %>
<% rs.movefirst %>
|
I don't understand why you have to use rs.movefirst there in the above code. I don't see it being initialized. What does "rs" contain? And why is that you are using it twice? Similarly in the NAMEs list code.
It is always better to check if the recordset contains something in it once it has been populated with execution of a query. Only if that contains some resultset, you should process further.
For example:
Code:
<% set rec=Server.CreateObject("ADODB.recordset") strsql3 = "select Agency From TBLagency order by Agency;" %>
rec.Open strsql3, conn
If NOT rec.EOF then
While not rec.EOF
'... Code to display the resultset formatted.
rec.MoveNext
Wend
Else
'... REC DOESNT CONTAIN ANYTHING IN IT
End If%>
Hope that helps.
Cheers!
_________________________
- Vijay G
Strive for Perfection