Professional Web Applications Themes

looking for options when saved parameter query returns empty recordset - ASP Database

I have 2 tables merely used for viewing (no updating or deleting or adding, etc.). table one has records of shipments and includes the file number as a field (file_num). table 2 holds comments about the progress of shipments, and also includes the field (file_num) I haven't linked the two tables because, well, I haven't seen a need to so far. i use a saved parameter queries (Access 2000 db) to display records from table 1, and the records' file numbers are hyperlinks to a new page which shows records in table 2 that have the same file number, also ...

  1. #1

    Default looking for options when saved parameter query returns empty recordset

    I have 2 tables merely used for viewing (no updating or deleting or
    adding, etc.).

    table one has records of shipments and includes the file number as a
    field (file_num).

    table 2 holds comments about the progress of shipments, and also
    includes the field (file_num)

    I haven't linked the two tables because, well, I haven't seen a need
    to so far.

    i use a saved parameter queries (Access 2000 db) to display records
    from table 1, and the records' file numbers are hyperlinks to a new
    page which shows records in table 2 that have the same file number,
    also using a saved parameter query. But if there are no comments yet
    in table 2, then the query returns with an error due to the empty
    recordset.

    Is there an easy way to perhaps test first to see if the recordset is
    empty to divert to another page that will give a meaningful message to
    the user?

    or perhaps even some way to test first to see if the table even
    contains the file_num in question before doing the query?

    Thanks for any ideas.

    Larry Rekow
    - - - - - - - - - - - - - - - - - -
    "Forget it, Jake. It's Chinatown."
    Larry Guest

  2. #2

    Default Re: looking for options when saved parameter query returns empty recordset

    Larry Rekow wrote: 

    What error? There should be no query error for an empty recordset. Are you
    checking the EOF property of the recordset object before trying to display
    data from that object?

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Guest

  3. #3

    Default Re: looking for options when saved parameter query returns empty recordset

    On Wed, 25 Aug 2004 14:56:18 -0400, "Bob Barrows [MVP]"
    <SPAMcom> wrote:

     
    ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++
    No....I googled some more and found that if i enclosed the loop with a

    "if not rs.eof then"
    and a
    "end if"

    then i did not get the error.

    Thanks again,

    Larry
    - - - - - - - - - - - - - - - - - -
    "Forget it, Jake. It's Chinatown."
    Larry Guest

Similar Threads

  1. Replies: 4
    Last Post: August 26th, 06:45 PM
  2. Another saved parameter query question (MSAccess XP)
    By Larry Rekow in forum ASP Database
    Replies: 2
    Last Post: August 5th, 02:47 AM
  3. MS Access d/b saved parameter query problem
    By Larry Rekow in forum ASP Database
    Replies: 3
    Last Post: August 3rd, 07:38 PM
  4. Date Parameter For Saved Parameter Queries
    By melody in forum ASP Database
    Replies: 13
    Last Post: December 19th, 09:22 AM
  5. Set an Empty Recordset?
    By Ray at in forum ASP
    Replies: 4
    Last Post: July 29th, 07:54 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139