Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 End of File (EOF)

Author  Topic 

infrontweb
Starting Member

13 Posts

Posted - 2002-07-24 : 16:39:47
Sorry this is a newbie question.
I want to display an error message on my ASP page when my stored procedure dosn't return a recorset because it was unable to match the users search criteria.
Do I have to pass a variable back to the calling ASP page when a recordset.EOF exists?

Thanks

MuffinMan
Posting Yak Master

107 Posts

Posted - 2002-07-24 : 16:55:06
Just test for EOF in your .asp page:



<%
....
.... connection and recordset creation goes here
....
rs.Open conn, strSqlStatement

if rs.EOF then
response.write "Unable to match search criteria."
else
do until rs.eof
'**** logic to display recordset goes here
rs.MoveNext
loop
end if

....
.... close and destory objects here
....
%>



Go to Top of Page

infrontweb
Starting Member

13 Posts

Posted - 2002-07-24 : 17:18:28
Got it thanks.

Works just fine.

E

Go to Top of Page
   

- Advertisement -