Select from table..

Results 1 to 3 of 3

Thread: Select from table..

  1. #1
    Join Date
    Dec 1969
    Posts
    52

    Default Select from table..

    Hope someone can help...I&#039m trying to get an art posting system going and everything is going well...I&#039m in the stages of trying to get it setup where people can comment on images as well..once again..all is going well..except one problem I have..whenever an image is posted it has no comments at first..so whenever someone goes to the comments.asp they see an error<BR>I use this in the comments.asp<BR><BR> stuff = Request.QueryString("id")<BR> rsSQL = "select * from Comment WHERE ImageID = " & stuff & " ORDER BY dateposted DESC"<BR><BR>So whenever someone goes to comments.asp?id=2 (image 2 not having any comments related) they get the error..I want it to display something like "no entries yet" instead of popping up this error..anyone know how...you can see what I mean here...<BR>http://www.tla.com/Lab/Roy/Gallery/comments.asp?id=1<BR>the one above works<BR>http://www.tla.com/Lab/Roy/Gallery/comments.asp?id=2<BR>the one above does not...!<BR>please post or email help...<BR>mailto: rdraper@tla.com

  2. #2
    Join Date
    Dec 1969
    Posts
    168

    Default RE: Select from table..

    &#060;%<BR>&#039Establish connection and open your recordset<BR><BR>If rs.BOF And rs.EOF Then <BR>&#039BOF & EOF indicates an empty recordset <BR>Response.Write("No comments yet")<BR><BR>else<BR>&#039Recordset contains data so let&#039s display it <BR><BR>On Error Resume Next<BR>rs.MoveFirst<BR>do while Not rs.eof<BR><BR>&#039put whatever html here to display the data<BR><BR>rs.MoveNext<BR>loop<BR>&#037;&#062;<BR ><BR>Hope this helps... Cheers!<BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    52

    Default RE: Select from table..

    Many thanks...it did the trick...I just have some touch ups to do..!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •