No results page


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: No results page

  1. #1
    Brett Guest

    No results page

    Hi

    How do I display a "Sorry, no results" message if my SQL query returns an
    empty recordset? I know in vb you can do something like:

    rs.movelast
    rs.movefirst

    If rs.recordcount = 0 then
    form.print "Sorry, no results"
    Else
    'continue

    but this doesn't seem to work with VB script.

    Any help?

    TIA

    Brett



  2. #2
    Craig Guest

    Re: No results page

    How about;

    if(rs.bof and rs.eof) then
    response.write("Sorry, no results")
    else
    'continue

    "Brett" <brett at primesite dot net> wrote in message
    news:39e15e52@news.devx.com...
    > Hi
    >
    > How do I display a "Sorry, no results" message if my SQL query returns an
    > empty recordset? I know in vb you can do something like:
    >
    > rs.movelast
    > rs.movefirst
    >
    > If rs.recordcount = 0 then
    > form.print "Sorry, no results"
    > Else
    > 'continue
    >
    > but this doesn't seem to work with VB script.
    >
    > Any help?
    >
    > TIA
    >
    > Brett
    >
    >




  3. #3
    Brett Guest

    Re: No results page

    Thanks Craig

    It works :-)

    Brett, a happy man with a headache

    "Craig" <cjewiss.nospam@hotmail.com> wrote in message
    news:39e16dbd$1@news.devx.com...
    > How about;
    >
    > if(rs.bof and rs.eof) then
    > response.write("Sorry, no results")
    > else
    > 'continue
    >
    > "Brett" <brett at primesite dot net> wrote in message
    > news:39e15e52@news.devx.com...
    > > Hi
    > >
    > > How do I display a "Sorry, no results" message if my SQL query returns

    an
    > > empty recordset? I know in vb you can do something like:
    > >
    > > rs.movelast
    > > rs.movefirst
    > >
    > > If rs.recordcount = 0 then
    > > form.print "Sorry, no results"
    > > Else
    > > 'continue
    > >
    > > but this doesn't seem to work with VB script.
    > >
    > > Any help?
    > >
    > > TIA
    > >
    > > Brett
    > >
    > >

    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center