View Single Post
  #5 (permalink)  
Old Jun 3rd, 2005, 09:15
benbacardi's Avatar
benbacardi benbacardi is offline
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
for your first problem....

presumably you are connecting to a database, and trying to output results?

before you can output anything, you need to check the database has actually returned something. you can do this by using ASPs built in EOF function. EOF means End of File. If you are opening a recordset, and then outputing data, use an if statement to check that you have actually got data before outputting it:

Code: Select all
rs = 'RECORDSET THAT IS OPEN

if rs.EOF = FALSE then

'CODE TO DISPLAY RECORDSET INFORMATION

else

response.write "The query returned no results"

end if