Recordset Errors / Friendly Message needed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dmiller23462

    Recordset Errors / Friendly Message needed

    My brain is nuked....Can anybody tell me right off the bat what is
    wrong with this code? Along with any glaring errors, please let me
    know the syntax to display a message (Response.Write would be fine I
    think) that will say "I'm sorry but the data you requested cannot be
    found" or something along those lines....

    This code is on an archive page I have on my company's intranet....The
    end result is to show 3 records at a time pulled from an Access DB and
    display on the screen....If the information IS found, everything seems
    to work alright but if it's not I get the error msg listed....Inste ad
    of that error msg I'd like to get the friendly message for the user
    basically saying "Sorry but your info can't be found" (see
    above)....Any help/suggestions would be great....I'm fried....In the
    process of trying to improve my work I broke it....I'm a newbie to ASP
    so please, hook a brother up with some advice...

    My error message....
    *****
    ADODB.Recordset error '800a0bcd'

    Either BOF or EOF is True, or the current record has been deleted.
    Requested operation requires a current record.

    /jax/wh/Online_Forms/Secured_Archive s/search_files/search_results_ wave.asp,
    line 57
    *****

    My code from search_results_ wave.asp....
    *****
    <!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->

    <%

    Mode = request.form("m ode")
    Name = request.form("n ame")
    Shift = request.form("s hift")
    Wave = request.form("w ave")
    Carton = request.form("c arton")
    Location = request.form("l ocation")
    License = request.form("l icense")
    Sku = request.form("s ku")
    Qty = request.form("q uantity")
    Reason = request.form("r eason")
    Comments = request.form("c omments")
    waveyear = request.form("w aveyear")
    wavemonth = request.form("w avemonth")
    waveday = request.form("w aveday")
    wavenumber = request.form("w avenumber")

    '************** *************** *************** *************** *************** ***
    '* DATABASE APPENDING
    *
    '************** *************** *************** *************** *************** ***
    If IsEmpty (Request.QueryS tring("pageNum" )) Then
    curPage = 1
    Else
    curPage = CInt(Request.Qu eryString("page Num"))
    End If

    'create db connection
    Set dbconn = Server.CreateOb ject("ADODB.Con nection")

    'open db in a DSN-less method
    dbconn.Open "PROVIDER=MICRO SOFT.JET.OLEDB. 4.0;DATA SOURCE="&
    Server.MapPath( "/jax/wh/Online_Forms/Secured_Archive s/search_files/shortage.mdb")

    'create recordset object
    Set rs = Server.CreateOb ject("ADODB.Rec ordset")

    'specify more info about rs
    rs.CursorLocati on = 3
    rs.CursorType = 3
    rs.PageSize = 3
    rs.open "shortage", dbconn

    'sql statement to return input values drawn from html fields within
    previous week
    SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear& wavemonth&
    waveday& wavenumber&"'"

    'display results of statement on screen for testing purposes
    Response.Write "<h3><b><u> " & (SQLqry) & "</u></b></h3><br>"

    'execute SQL statement
    'Set db = dbconn.Execute( SQLqry)

    rs.Close
    rs.Open SQLqry

    rs.AbsolutePage = curPage
    Response.Write "<p>You are on page: " & curPage & " of " &
    rs.PageCount
    Response.Write "<br>"
    Response.Write "<br>"

    For i = 1 to rs.PageSize
    If rs.EOF Then Exit For
    Response.Write "<b>Name :</b> " & rs("name")
    Response.Write "<br>"
    Response.Write "<b>Shift :</b> " & rs("shift")
    Response.Write "<br>"
    Response.Write "<b>Wave Number :</b> " & rs("wave")
    Response.Write "<br>"
    Response.Write "<b>Carton Number :</b> " & rs("carton")
    Response.Write "<br>"
    Response.Write "<b>Locatio n :</b> " & rs("location")
    Response.Write "<br>"
    Response.Write "<b>License :</b> " & rs("license")
    Response.Write "<br>"
    Response.Write "<b>SKU :</b> " & rs("sku")
    Response.Write "<br>"
    Response.Write "<b>Quantit y :</b> " & rs("qty")
    Response.Write "<br>"
    Response.Write "<b>Reason :</b> " & rs("reason")
    Response.Write "<br>"
    Response.Write "<b>Comment s :</b> " & rs("comments")
    Response.Write "<br>"
    Response.Write "<b>Date Submitted :</b> " & rs("date")
    Response.Write "<hr>"
    rs.MoveNext
    Next

    If curPage > 1 then
    Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
    curPage-1 & "'>Previous </a>"
    If curPage < rs.PageCount then
    Response.Write " | "
    end if
    end if
    If curPage < rs.PageCount then
    Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
    curPage+1 & "'>Next</a>"
    end if

    'close recordset
    rs.Close

    'zero out recordset object
    Set rs = Nothing

    'smack around the db connection until it lets go
    dbconn.Close

    'terminate db connection with extreme prejudice
    set dbconn = nothing

    %>

    <br><a href="../Archives.asp">R eturn to Archives</a>
    <br><a href="../../Shortage.asp">R eturn to Shortage Submission
    Form</a>
    <br><a href="../../../default.asp">Re turn to Warehouse
    Operations</a><!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->
    *****
  • Aaron [SQL Server MVP]

    #2
    Re: Recordset Errors / Friendly Message needed

    First, better paging techniques:



    Second,

    set rs = conn.execute(sq l)
    if rs.eof then
    response.write "Hi, I'm a friendly error message. You won't be
    seeing any data today."
    else
    ' do stuff
    end if

    --

    (Reverse address to reply.)




    "dmiller234 62" <dmiller23462@y ahoo.com> wrote in message
    news:591ac515.0 407291022.252d5 53a@posting.goo gle.com...[color=blue]
    > My brain is nuked....Can anybody tell me right off the bat what is
    > wrong with this code? Along with any glaring errors, please let me
    > know the syntax to display a message (Response.Write would be fine I
    > think) that will say "I'm sorry but the data you requested cannot be
    > found" or something along those lines....
    >
    > This code is on an archive page I have on my company's intranet....The
    > end result is to show 3 records at a time pulled from an Access DB and
    > display on the screen....If the information IS found, everything seems
    > to work alright but if it's not I get the error msg listed....Inste ad
    > of that error msg I'd like to get the friendly message for the user
    > basically saying "Sorry but your info can't be found" (see
    > above)....Any help/suggestions would be great....I'm fried....In the
    > process of trying to improve my work I broke it....I'm a newbie to ASP
    > so please, hook a brother up with some advice...
    >
    > My error message....
    > *****
    > ADODB.Recordset error '800a0bcd'
    >
    > Either BOF or EOF is True, or the current record has been deleted.
    > Requested operation requires a current record.
    >
    >[/color]
    /jax/wh/Online_Forms/Secured_Archive s/search_files/search_results_ wave.asp,[color=blue]
    > line 57
    > *****
    >
    > My code from search_results_ wave.asp....
    > *****
    > <!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->
    >
    > <%
    >
    > Mode = request.form("m ode")
    > Name = request.form("n ame")
    > Shift = request.form("s hift")
    > Wave = request.form("w ave")
    > Carton = request.form("c arton")
    > Location = request.form("l ocation")
    > License = request.form("l icense")
    > Sku = request.form("s ku")
    > Qty = request.form("q uantity")
    > Reason = request.form("r eason")
    > Comments = request.form("c omments")
    > waveyear = request.form("w aveyear")
    > wavemonth = request.form("w avemonth")
    > waveday = request.form("w aveday")
    > wavenumber = request.form("w avenumber")
    >
    >[/color]
    '************** *************** *************** *************** *************** *
    **[color=blue]
    > '* DATABASE APPENDING
    > *
    >[/color]
    '************** *************** *************** *************** *************** *
    **[color=blue]
    > If IsEmpty (Request.QueryS tring("pageNum" )) Then
    > curPage = 1
    > Else
    > curPage = CInt(Request.Qu eryString("page Num"))
    > End If
    >
    > 'create db connection
    > Set dbconn = Server.CreateOb ject("ADODB.Con nection")
    >
    > 'open db in a DSN-less method
    > dbconn.Open "PROVIDER=MICRO SOFT.JET.OLEDB. 4.0;DATA SOURCE="&
    >[/color]
    Server.MapPath( "/jax/wh/Online_Forms/Secured_Archive s/search_files/shortage.
    mdb")[color=blue]
    >
    > 'create recordset object
    > Set rs = Server.CreateOb ject("ADODB.Rec ordset")
    >
    > 'specify more info about rs
    > rs.CursorLocati on = 3
    > rs.CursorType = 3
    > rs.PageSize = 3
    > rs.open "shortage", dbconn
    >
    > 'sql statement to return input values drawn from html fields within
    > previous week
    > SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear& wavemonth&
    > waveday& wavenumber&"'"
    >
    > 'display results of statement on screen for testing purposes
    > Response.Write "<h3><b><u> " & (SQLqry) & "</u></b></h3><br>"
    >
    > 'execute SQL statement
    > 'Set db = dbconn.Execute( SQLqry)
    >
    > rs.Close
    > rs.Open SQLqry
    >
    > rs.AbsolutePage = curPage
    > Response.Write "<p>You are on page: " & curPage & " of " &
    > rs.PageCount
    > Response.Write "<br>"
    > Response.Write "<br>"
    >
    > For i = 1 to rs.PageSize
    > If rs.EOF Then Exit For
    > Response.Write "<b>Name :</b> " & rs("name")
    > Response.Write "<br>"
    > Response.Write "<b>Shift :</b> " & rs("shift")
    > Response.Write "<br>"
    > Response.Write "<b>Wave Number :</b> " & rs("wave")
    > Response.Write "<br>"
    > Response.Write "<b>Carton Number :</b> " & rs("carton")
    > Response.Write "<br>"
    > Response.Write "<b>Locatio n :</b> " & rs("location")
    > Response.Write "<br>"
    > Response.Write "<b>License :</b> " & rs("license")
    > Response.Write "<br>"
    > Response.Write "<b>SKU :</b> " & rs("sku")
    > Response.Write "<br>"
    > Response.Write "<b>Quantit y :</b> " & rs("qty")
    > Response.Write "<br>"
    > Response.Write "<b>Reason :</b> " & rs("reason")
    > Response.Write "<br>"
    > Response.Write "<b>Comment s :</b> " & rs("comments")
    > Response.Write "<br>"
    > Response.Write "<b>Date Submitted :</b> " & rs("date")
    > Response.Write "<hr>"
    > rs.MoveNext
    > Next
    >
    > If curPage > 1 then
    > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
    > curPage-1 & "'>Previous </a>"
    > If curPage < rs.PageCount then
    > Response.Write " | "
    > end if
    > end if
    > If curPage < rs.PageCount then
    > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
    > curPage+1 & "'>Next</a>"
    > end if
    >
    > 'close recordset
    > rs.Close
    >
    > 'zero out recordset object
    > Set rs = Nothing
    >
    > 'smack around the db connection until it lets go
    > dbconn.Close
    >
    > 'terminate db connection with extreme prejudice
    > set dbconn = nothing
    >
    > %>
    >
    > <br><a href="../Archives.asp">R eturn to Archives</a>
    > <br><a href="../../Shortage.asp">R eturn to Shortage Submission
    > Form</a>
    > <br><a href="../../../default.asp">Re turn to Warehouse
    > Operations</a><!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->
    > *****[/color]


    Comment

    • Steven Burn

      #3
      Re: Recordset Errors / Friendly Message needed

      The error you mentioned means the record thats been requested does not exist
      in the database.

      All I do to get past this is use a function that queries the database for
      the record # thats requested, and re-dir to a friendly "stop requesting
      invalid records" page ;o)

      --

      Regards

      Steven Burn
      Ur I.T. Mate Group


      Keeping it FREE!


      "dmiller234 62" <dmiller23462@y ahoo.com> wrote in message
      news:591ac515.0 407291022.252d5 53a@posting.goo gle.com...[color=blue]
      > My brain is nuked....Can anybody tell me right off the bat what is
      > wrong with this code? Along with any glaring errors, please let me
      > know the syntax to display a message (Response.Write would be fine I
      > think) that will say "I'm sorry but the data you requested cannot be
      > found" or something along those lines....
      >
      > This code is on an archive page I have on my company's intranet....The
      > end result is to show 3 records at a time pulled from an Access DB and
      > display on the screen....If the information IS found, everything seems
      > to work alright but if it's not I get the error msg listed....Inste ad
      > of that error msg I'd like to get the friendly message for the user
      > basically saying "Sorry but your info can't be found" (see
      > above)....Any help/suggestions would be great....I'm fried....In the
      > process of trying to improve my work I broke it....I'm a newbie to ASP
      > so please, hook a brother up with some advice...
      >
      > My error message....
      > *****
      > ADODB.Recordset error '800a0bcd'
      >
      > Either BOF or EOF is True, or the current record has been deleted.
      > Requested operation requires a current record.
      >
      >[/color]
      /jax/wh/Online_Forms/Secured_Archive s/search_files/search_results_ wave.asp,[color=blue]
      > line 57
      > *****
      >
      > My code from search_results_ wave.asp....
      > *****
      > <!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->
      >
      > <%
      >
      > Mode = request.form("m ode")
      > Name = request.form("n ame")
      > Shift = request.form("s hift")
      > Wave = request.form("w ave")
      > Carton = request.form("c arton")
      > Location = request.form("l ocation")
      > License = request.form("l icense")
      > Sku = request.form("s ku")
      > Qty = request.form("q uantity")
      > Reason = request.form("r eason")
      > Comments = request.form("c omments")
      > waveyear = request.form("w aveyear")
      > wavemonth = request.form("w avemonth")
      > waveday = request.form("w aveday")
      > wavenumber = request.form("w avenumber")
      >
      >[/color]
      '************** *************** *************** *************** *************** *
      **[color=blue]
      > '* DATABASE APPENDING
      > *
      >[/color]
      '************** *************** *************** *************** *************** *
      **[color=blue]
      > If IsEmpty (Request.QueryS tring("pageNum" )) Then
      > curPage = 1
      > Else
      > curPage = CInt(Request.Qu eryString("page Num"))
      > End If
      >
      > 'create db connection
      > Set dbconn = Server.CreateOb ject("ADODB.Con nection")
      >
      > 'open db in a DSN-less method
      > dbconn.Open "PROVIDER=MICRO SOFT.JET.OLEDB. 4.0;DATA SOURCE="&
      >[/color]
      Server.MapPath( "/jax/wh/Online_Forms/Secured_Archive s/search_files/shortage.
      mdb")[color=blue]
      >
      > 'create recordset object
      > Set rs = Server.CreateOb ject("ADODB.Rec ordset")
      >
      > 'specify more info about rs
      > rs.CursorLocati on = 3
      > rs.CursorType = 3
      > rs.PageSize = 3
      > rs.open "shortage", dbconn
      >
      > 'sql statement to return input values drawn from html fields within
      > previous week
      > SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear& wavemonth&
      > waveday& wavenumber&"'"
      >
      > 'display results of statement on screen for testing purposes
      > Response.Write "<h3><b><u> " & (SQLqry) & "</u></b></h3><br>"
      >
      > 'execute SQL statement
      > 'Set db = dbconn.Execute( SQLqry)
      >
      > rs.Close
      > rs.Open SQLqry
      >
      > rs.AbsolutePage = curPage
      > Response.Write "<p>You are on page: " & curPage & " of " &
      > rs.PageCount
      > Response.Write "<br>"
      > Response.Write "<br>"
      >
      > For i = 1 to rs.PageSize
      > If rs.EOF Then Exit For
      > Response.Write "<b>Name :</b> " & rs("name")
      > Response.Write "<br>"
      > Response.Write "<b>Shift :</b> " & rs("shift")
      > Response.Write "<br>"
      > Response.Write "<b>Wave Number :</b> " & rs("wave")
      > Response.Write "<br>"
      > Response.Write "<b>Carton Number :</b> " & rs("carton")
      > Response.Write "<br>"
      > Response.Write "<b>Locatio n :</b> " & rs("location")
      > Response.Write "<br>"
      > Response.Write "<b>License :</b> " & rs("license")
      > Response.Write "<br>"
      > Response.Write "<b>SKU :</b> " & rs("sku")
      > Response.Write "<br>"
      > Response.Write "<b>Quantit y :</b> " & rs("qty")
      > Response.Write "<br>"
      > Response.Write "<b>Reason :</b> " & rs("reason")
      > Response.Write "<br>"
      > Response.Write "<b>Comment s :</b> " & rs("comments")
      > Response.Write "<br>"
      > Response.Write "<b>Date Submitted :</b> " & rs("date")
      > Response.Write "<hr>"
      > rs.MoveNext
      > Next
      >
      > If curPage > 1 then
      > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
      > curPage-1 & "'>Previous </a>"
      > If curPage < rs.PageCount then
      > Response.Write " | "
      > end if
      > end if
      > If curPage < rs.PageCount then
      > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
      > curPage+1 & "'>Next</a>"
      > end if
      >
      > 'close recordset
      > rs.Close
      >
      > 'zero out recordset object
      > Set rs = Nothing
      >
      > 'smack around the db connection until it lets go
      > dbconn.Close
      >
      > 'terminate db connection with extreme prejudice
      > set dbconn = nothing
      >
      > %>
      >
      > <br><a href="../Archives.asp">R eturn to Archives</a>
      > <br><a href="../../Shortage.asp">R eturn to Shortage Submission
      > Form</a>
      > <br><a href="../../../default.asp">Re turn to Warehouse
      > Operations</a><!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->
      > *****[/color]


      Comment

      • dmiller23462

        #4
        Re: Recordset Errors / Friendly Message needed

        How exactly can I go about doing that? I mean what is the syntax for
        that option? I've been playing around with If statements and "Do Until
        rs.EOF" statements and I keep breaking it....Things work great if the
        data is found but if the string that is being searched for is not
        found, it crashes...

        "Steven Burn" <pvt@noyb.com > wrote in message news:<evGbxyZdE HA.2504@TK2MSFT NGP12.phx.gbl>. ..[color=blue]
        > The error you mentioned means the record thats been requested does not exist
        > in the database.
        >
        > All I do to get past this is use a function that queries the database for
        > the record # thats requested, and re-dir to a friendly "stop requesting
        > invalid records" page ;o)
        >
        > --
        >
        > Regards
        >
        > Steven Burn
        > Ur I.T. Mate Group
        > www.it-mate.co.uk
        >
        > Keeping it FREE!
        >
        >
        > "dmiller234 62" <dmiller23462@y ahoo.com> wrote in message
        > news:591ac515.0 407291022.252d5 53a@posting.goo gle.com...[color=green]
        > > My brain is nuked....Can anybody tell me right off the bat what is
        > > wrong with this code? Along with any glaring errors, please let me
        > > know the syntax to display a message (Response.Write would be fine I
        > > think) that will say "I'm sorry but the data you requested cannot be
        > > found" or something along those lines....
        > >
        > > This code is on an archive page I have on my company's intranet....The
        > > end result is to show 3 records at a time pulled from an Access DB and
        > > display on the screen....If the information IS found, everything seems
        > > to work alright but if it's not I get the error msg listed....Inste ad
        > > of that error msg I'd like to get the friendly message for the user
        > > basically saying "Sorry but your info can't be found" (see
        > > above)....Any help/suggestions would be great....I'm fried....In the
        > > process of trying to improve my work I broke it....I'm a newbie to ASP
        > > so please, hook a brother up with some advice...
        > >
        > > My error message....
        > > *****
        > > ADODB.Recordset error '800a0bcd'
        > >
        > > Either BOF or EOF is True, or the current record has been deleted.
        > > Requested operation requires a current record.
        > >
        > >[/color]
        > /jax/wh/Online_Forms/Secured_Archive s/search_files/search_results_ wave.asp,[color=green]
        > > line 57
        > > *****
        > >
        > > My code from search_results_ wave.asp....
        > > *****
        > > <!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->
        > >
        > > <%
        > >
        > > Mode = request.form("m ode")
        > > Name = request.form("n ame")
        > > Shift = request.form("s hift")
        > > Wave = request.form("w ave")
        > > Carton = request.form("c arton")
        > > Location = request.form("l ocation")
        > > License = request.form("l icense")
        > > Sku = request.form("s ku")
        > > Qty = request.form("q uantity")
        > > Reason = request.form("r eason")
        > > Comments = request.form("c omments")
        > > waveyear = request.form("w aveyear")
        > > wavemonth = request.form("w avemonth")
        > > waveday = request.form("w aveday")
        > > wavenumber = request.form("w avenumber")
        > >
        > >[/color]
        > '************** *************** *************** *************** *************** *
        > **[color=green]
        > > '* DATABASE APPENDING
        > > *
        > >[/color]
        > '************** *************** *************** *************** *************** *
        > **[color=green]
        > > If IsEmpty (Request.QueryS tring("pageNum" )) Then
        > > curPage = 1
        > > Else
        > > curPage = CInt(Request.Qu eryString("page Num"))
        > > End If
        > >
        > > 'create db connection
        > > Set dbconn = Server.CreateOb ject("ADODB.Con nection")
        > >
        > > 'open db in a DSN-less method
        > > dbconn.Open "PROVIDER=MICRO SOFT.JET.OLEDB. 4.0;DATA SOURCE="&
        > >[/color]
        > Server.MapPath( "/jax/wh/Online_Forms/Secured_Archive s/search_files/shortage.
        > mdb")[color=green]
        > >
        > > 'create recordset object
        > > Set rs = Server.CreateOb ject("ADODB.Rec ordset")
        > >
        > > 'specify more info about rs
        > > rs.CursorLocati on = 3
        > > rs.CursorType = 3
        > > rs.PageSize = 3
        > > rs.open "shortage", dbconn
        > >
        > > 'sql statement to return input values drawn from html fields within
        > > previous week
        > > SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear& wavemonth&
        > > waveday& wavenumber&"'"
        > >
        > > 'display results of statement on screen for testing purposes
        > > Response.Write "<h3><b><u> " & (SQLqry) & "</u></b></h3><br>"
        > >
        > > 'execute SQL statement
        > > 'Set db = dbconn.Execute( SQLqry)
        > >
        > > rs.Close
        > > rs.Open SQLqry
        > >
        > > rs.AbsolutePage = curPage
        > > Response.Write "<p>You are on page: " & curPage & " of " &
        > > rs.PageCount
        > > Response.Write "<br>"
        > > Response.Write "<br>"
        > >
        > > For i = 1 to rs.PageSize
        > > If rs.EOF Then Exit For
        > > Response.Write "<b>Name :</b> " & rs("name")
        > > Response.Write "<br>"
        > > Response.Write "<b>Shift :</b> " & rs("shift")
        > > Response.Write "<br>"
        > > Response.Write "<b>Wave Number :</b> " & rs("wave")
        > > Response.Write "<br>"
        > > Response.Write "<b>Carton Number :</b> " & rs("carton")
        > > Response.Write "<br>"
        > > Response.Write "<b>Locatio n :</b> " & rs("location")
        > > Response.Write "<br>"
        > > Response.Write "<b>License :</b> " & rs("license")
        > > Response.Write "<br>"
        > > Response.Write "<b>SKU :</b> " & rs("sku")
        > > Response.Write "<br>"
        > > Response.Write "<b>Quantit y :</b> " & rs("qty")
        > > Response.Write "<br>"
        > > Response.Write "<b>Reason :</b> " & rs("reason")
        > > Response.Write "<br>"
        > > Response.Write "<b>Comment s :</b> " & rs("comments")
        > > Response.Write "<br>"
        > > Response.Write "<b>Date Submitted :</b> " & rs("date")
        > > Response.Write "<hr>"
        > > rs.MoveNext
        > > Next
        > >
        > > If curPage > 1 then
        > > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
        > > curPage-1 & "'>Previous </a>"
        > > If curPage < rs.PageCount then
        > > Response.Write " | "
        > > end if
        > > end if
        > > If curPage < rs.PageCount then
        > > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
        > > curPage+1 & "'>Next</a>"
        > > end if
        > >
        > > 'close recordset
        > > rs.Close
        > >
        > > 'zero out recordset object
        > > Set rs = Nothing
        > >
        > > 'smack around the db connection until it lets go
        > > dbconn.Close
        > >
        > > 'terminate db connection with extreme prejudice
        > > set dbconn = nothing
        > >
        > > %>
        > >
        > > <br><a href="../Archives.asp">R eturn to Archives</a>
        > > <br><a href="../../Shortage.asp">R eturn to Shortage Submission
        > > Form</a>
        > > <br><a href="../../../default.asp">Re turn to Warehouse
        > > Operations</a><!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->
        > > *****[/color][/color]

        Comment

        • Steven Burn

          #5
          Re: Recordset Errors / Friendly Message needed

          '// Replace the_database.md b with the filename of your database
          Const objDB = "the_Database.m db"

          Function ConnectToDB(dbP ath)
          '// The code you use to connect to your database goes here
          Set DB = Server.Createob ject("ADODB.Con nection")
          DB.Mode = adModeReadWrite
          DB.Open ("PROVIDER=Micr osoft.Jet.OLEDB .4.0;DATA SOURCE=" +
          Server.MapPath( dbPath))
          Set ConnectToDB = DB
          End Function

          Function RecordExists(sI D)
          Set DB = ConnectToDB(obj DB)
          Set rst = Server.CreateOb ject("ADODB.Rec ordset")
          rst.open "Select ID from tblSomeTable", DB, adOpenStatic, adLockReadOnly
          Do While Not rst.eof
          If CLng(rst("ID")) =CLng(sID) Then
          RecordExists = true
          Exit Do
          End If
          rst.Movenext
          Loop
          End Function

          --

          Regards

          Steven Burn
          Ur I.T. Mate Group


          Keeping it FREE!


          "dmiller234 62" <dmiller23462@y ahoo.com> wrote in message
          news:591ac515.0 408021025.125f6 629@posting.goo gle.com...[color=blue]
          > How exactly can I go about doing that? I mean what is the syntax for
          > that option? I've been playing around with If statements and "Do Until
          > rs.EOF" statements and I keep breaking it....Things work great if the
          > data is found but if the string that is being searched for is not
          > found, it crashes...
          >
          > "Steven Burn" <pvt@noyb.com > wrote in message[/color]
          news:<evGbxyZdE HA.2504@TK2MSFT NGP12.phx.gbl>. ..[color=blue][color=green]
          > > The error you mentioned means the record thats been requested does not[/color][/color]
          exist[color=blue][color=green]
          > > in the database.
          > >
          > > All I do to get past this is use a function that queries the database[/color][/color]
          for[color=blue][color=green]
          > > the record # thats requested, and re-dir to a friendly "stop requesting
          > > invalid records" page ;o)
          > >
          > > --
          > >
          > > Regards
          > >
          > > Steven Burn
          > > Ur I.T. Mate Group
          > > www.it-mate.co.uk
          > >
          > > Keeping it FREE!
          > >
          > >
          > > "dmiller234 62" <dmiller23462@y ahoo.com> wrote in message
          > > news:591ac515.0 407291022.252d5 53a@posting.goo gle.com...[color=darkred]
          > > > My brain is nuked....Can anybody tell me right off the bat what is
          > > > wrong with this code? Along with any glaring errors, please let me
          > > > know the syntax to display a message (Response.Write would be fine I
          > > > think) that will say "I'm sorry but the data you requested cannot be
          > > > found" or something along those lines....
          > > >
          > > > This code is on an archive page I have on my company's intranet....The
          > > > end result is to show 3 records at a time pulled from an Access DB and
          > > > display on the screen....If the information IS found, everything seems
          > > > to work alright but if it's not I get the error msg listed....Inste ad
          > > > of that error msg I'd like to get the friendly message for the user
          > > > basically saying "Sorry but your info can't be found" (see
          > > > above)....Any help/suggestions would be great....I'm fried....In the
          > > > process of trying to improve my work I broke it....I'm a newbie to ASP
          > > > so please, hook a brother up with some advice...
          > > >
          > > > My error message....
          > > > *****
          > > > ADODB.Recordset error '800a0bcd'
          > > >
          > > > Either BOF or EOF is True, or the current record has been deleted.
          > > > Requested operation requires a current record.
          > > >
          > > >[/color]
          > >[/color][/color]
          /jax/wh/Online_Forms/Secured_Archive s/search_files/search_results_ wave.asp,[color=blue][color=green][color=darkred]
          > > > line 57
          > > > *****
          > > >
          > > > My code from search_results_ wave.asp....
          > > > *****
          > > > <!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->
          > > >
          > > > <%
          > > >
          > > > Mode = request.form("m ode")
          > > > Name = request.form("n ame")
          > > > Shift = request.form("s hift")
          > > > Wave = request.form("w ave")
          > > > Carton = request.form("c arton")
          > > > Location = request.form("l ocation")
          > > > License = request.form("l icense")
          > > > Sku = request.form("s ku")
          > > > Qty = request.form("q uantity")
          > > > Reason = request.form("r eason")
          > > > Comments = request.form("c omments")
          > > > waveyear = request.form("w aveyear")
          > > > wavemonth = request.form("w avemonth")
          > > > waveday = request.form("w aveday")
          > > > wavenumber = request.form("w avenumber")
          > > >
          > > >[/color]
          > >[/color][/color]
          '************** *************** *************** *************** *************** *[color=blue][color=green]
          > > **[color=darkred]
          > > > '* DATABASE APPENDING
          > > > *
          > > >[/color]
          > >[/color][/color]
          '************** *************** *************** *************** *************** *[color=blue][color=green]
          > > **[color=darkred]
          > > > If IsEmpty (Request.QueryS tring("pageNum" )) Then
          > > > curPage = 1
          > > > Else
          > > > curPage = CInt(Request.Qu eryString("page Num"))
          > > > End If
          > > >
          > > > 'create db connection
          > > > Set dbconn = Server.CreateOb ject("ADODB.Con nection")
          > > >
          > > > 'open db in a DSN-less method
          > > > dbconn.Open "PROVIDER=MICRO SOFT.JET.OLEDB. 4.0;DATA SOURCE="&
          > > >[/color]
          > >[/color][/color]
          Server.MapPath( "/jax/wh/Online_Forms/Secured_Archive s/search_files/shortage.[color=blue][color=green]
          > > mdb")[color=darkred]
          > > >
          > > > 'create recordset object
          > > > Set rs = Server.CreateOb ject("ADODB.Rec ordset")
          > > >
          > > > 'specify more info about rs
          > > > rs.CursorLocati on = 3
          > > > rs.CursorType = 3
          > > > rs.PageSize = 3
          > > > rs.open "shortage", dbconn
          > > >
          > > > 'sql statement to return input values drawn from html fields within
          > > > previous week
          > > > SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear& wavemonth&
          > > > waveday& wavenumber&"'"
          > > >
          > > > 'display results of statement on screen for testing purposes
          > > > Response.Write "<h3><b><u> " & (SQLqry) & "</u></b></h3><br>"
          > > >
          > > > 'execute SQL statement
          > > > 'Set db = dbconn.Execute( SQLqry)
          > > >
          > > > rs.Close
          > > > rs.Open SQLqry
          > > >
          > > > rs.AbsolutePage = curPage
          > > > Response.Write "<p>You are on page: " & curPage & " of " &
          > > > rs.PageCount
          > > > Response.Write "<br>"
          > > > Response.Write "<br>"
          > > >
          > > > For i = 1 to rs.PageSize
          > > > If rs.EOF Then Exit For
          > > > Response.Write "<b>Name :</b> " & rs("name")
          > > > Response.Write "<br>"
          > > > Response.Write "<b>Shift :</b> " & rs("shift")
          > > > Response.Write "<br>"
          > > > Response.Write "<b>Wave Number :</b> " & rs("wave")
          > > > Response.Write "<br>"
          > > > Response.Write "<b>Carton Number :</b> " & rs("carton")
          > > > Response.Write "<br>"
          > > > Response.Write "<b>Locatio n :</b> " & rs("location")
          > > > Response.Write "<br>"
          > > > Response.Write "<b>License :</b> " & rs("license")
          > > > Response.Write "<br>"
          > > > Response.Write "<b>SKU :</b> " & rs("sku")
          > > > Response.Write "<br>"
          > > > Response.Write "<b>Quantit y :</b> " & rs("qty")
          > > > Response.Write "<br>"
          > > > Response.Write "<b>Reason :</b> " & rs("reason")
          > > > Response.Write "<br>"
          > > > Response.Write "<b>Comment s :</b> " & rs("comments")
          > > > Response.Write "<br>"
          > > > Response.Write "<b>Date Submitted :</b> " & rs("date")
          > > > Response.Write "<hr>"
          > > > rs.MoveNext
          > > > Next
          > > >
          > > > If curPage > 1 then
          > > > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
          > > > curPage-1 & "'>Previous </a>"
          > > > If curPage < rs.PageCount then
          > > > Response.Write " | "
          > > > end if
          > > > end if
          > > > If curPage < rs.PageCount then
          > > > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
          > > > curPage+1 & "'>Next</a>"
          > > > end if
          > > >
          > > > 'close recordset
          > > > rs.Close
          > > >
          > > > 'zero out recordset object
          > > > Set rs = Nothing
          > > >
          > > > 'smack around the db connection until it lets go
          > > > dbconn.Close
          > > >
          > > > 'terminate db connection with extreme prejudice
          > > > set dbconn = nothing
          > > >
          > > > %>
          > > >
          > > > <br><a href="../Archives.asp">R eturn to Archives</a>
          > > > <br><a href="../../Shortage.asp">R eturn to Shortage Submission
          > > > Form</a>
          > > > <br><a href="../../../default.asp">Re turn to Warehouse
          > > > Operations</a><!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->
          > > > *****[/color][/color][/color]


          Comment

          • dmiller23462

            #6
            Re: Recordset Errors / Friendly Message needed

            I have inserted my own variables into this code and still no luck....I
            kept getting an error message that it an object was
            required....Tra cking it down to the line containing "rs.Open SQLqry" I
            think it's because my first mention of the recordset variable "rs" is
            within the "Function RecordExists(sI D)" code...I've tried opening and
            closing it OUTSIDE of the function and it's not working....Once again,
            I'm a bit frazzled (still new to me) and this is the code I currently
            have...

            I took the code OUTSIDE of the function....Pro bably not a good idea
            but that was part of my experimenting.. ..Take a look and then e-slap
            me...
            *****
            <%

            Mode = request.form("m ode")
            Name = request.form("n ame")
            Shift = request.form("s hift")
            Wave = request.form("w ave")
            Carton = request.form("c arton")
            Location = request.form("l ocation")
            License = request.form("l icense")
            Sku = request.form("s ku")
            Qty = request.form("q uantity")
            Reason = request.form("r eason")
            Comments = request.form("c omments")
            waveyear = request.form("w aveyear")
            wavemonth = request.form("w avemonth")
            waveday = request.form("w aveday")
            wavenumber = request.form("w avenumber")
            entirewave = request.form("w aveyear") & request.form("w avemonth") &
            request.form("w aveday") & request.form("w avenumber")

            '************** *************** *************** *************** *************** ***
            '* DATABASE APPENDING
            *
            '************** *************** *************** *************** *************** ***
            'create db connection
            Set dbconn = Server.CreateOb ject("ADODB.Con nection")
            dbconn.Mode = adModeReadWrite

            'open db in a DSN-less method
            dbconn.Open "PROVIDER=MICRO SOFT.JET.OLEDB. 4.0;DATA SOURCE="&
            Server.MapPath( "/jax/wh/Online_Forms/Secured_Archive s/search_files/shortage.mdb")

            Set rs = Server.CreateOb ject("ADODB.Rec ordset")
            rs.CursorLocati on = 3
            rs.CursorType = 3
            rs.PageSize = 3
            rs.open "shortage", dbconn

            Do While Not rs.eof
            If CLng(entirewave )=Null Then
            RecordExists = false
            Exit Do
            End If
            rs.Movenext
            Loop
            rs.Close

            If IsEmpty (Request.QueryS tring("pageNum" )) Then
            curPage = 1
            Else
            curPage = CInt(Request.Qu eryString("page Num"))
            End If

            'create recordset object
            Set rs = Server.CreateOb ject("ADODB.Rec ordset")

            'sql statement to return input values drawn from html fields within
            previous week
            SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear& wavemonth&
            waveday& wavenumber&"'"

            'display results of statement on screen for testing purposes
            Response.Write "<h3><b><u> " & (SQLqry) & "</u></b></h3><br>"

            rs.Open SQLqry

            rs.AbsolutePage = curPage
            Response.Write "<p>You are on page: " & curPage & " of " &
            rs.PageCount
            Response.Write "<br>"
            Response.Write "<br>"

            For i = 1 to rs.PageSize
            If rs.EOF Then Exit For
            Response.Write "<b>Name :</b> " & rs("name")
            Response.Write "<br>"
            Response.Write "<b>Shift :</b> " & rs("shift")
            Response.Write "<br>"
            Response.Write "<b>Wave Number :</b> " & rs("wave")
            Response.Write "<br>"
            Response.Write "<b>Carton Number :</b> " & rs("carton")
            Response.Write "<br>"
            Response.Write "<b>Locatio n :</b> " & rs("location")
            Response.Write "<br>"
            Response.Write "<b>License :</b> " & rs("license")
            Response.Write "<br>"
            Response.Write "<b>SKU :</b> " & rs("sku")
            Response.Write "<br>"
            Response.Write "<b>Quantit y :</b> " & rs("qty")
            Response.Write "<br>"
            Response.Write "<b>Reason :</b> " & rs("reason")
            Response.Write "<br>"
            Response.Write "<b>Comment s :</b> " & rs("comments")
            Response.Write "<br>"
            Response.Write "<b>Date Submitted :</b> " & rs("date")
            Response.Write "<hr>"
            rs.MoveNext
            Next


            If curPage > 1 then
            Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
            curPage-1 & "'>Previous </a>"
            If curPage < rs.PageCount then
            Response.Write " | "
            end if
            end if
            If curPage < rs.PageCount then
            Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
            curPage+1 & "'>Next</a>"
            end if

            'close recordset
            rs.Close

            'zero out recordset object
            Set rs = Nothing

            'smack around the db connection until it lets go
            dbconn.Close

            'terminate db connection with extreme prejudice
            set dbconn = nothing
            %>

            *****


            "Steven Burn" <pvt@noyb.com > wrote in message news:<#1dM2FMeE HA.3792@TK2MSFT NGP09.phx.gbl>. ..[color=blue]
            > '// Replace the_database.md b with the filename of your database
            > Const objDB = "the_Database.m db"
            >
            > Function ConnectToDB(dbP ath)
            > '// The code you use to connect to your database goes here
            > Set DB = Server.Createob ject("ADODB.Con nection")
            > DB.Mode = adModeReadWrite
            > DB.Open ("PROVIDER=Micr osoft.Jet.OLEDB .4.0;DATA SOURCE=" +
            > Server.MapPath( dbPath))
            > Set ConnectToDB = DB
            > End Function
            >
            > Function RecordExists(sI D)
            > Set DB = ConnectToDB(obj DB)
            > Set rst = Server.CreateOb ject("ADODB.Rec ordset")
            > rst.open "Select ID from tblSomeTable", DB, adOpenStatic, adLockReadOnly
            > Do While Not rst.eof
            > If CLng(rst("ID")) =CLng(sID) Then
            > RecordExists = true
            > Exit Do
            > End If
            > rst.Movenext
            > Loop
            > End Function
            >
            > --
            >
            > Regards
            >
            > Steven Burn
            > Ur I.T. Mate Group
            > www.it-mate.co.uk
            >
            > Keeping it FREE!
            >
            >
            > "dmiller234 62" <dmiller23462@y ahoo.com> wrote in message
            > news:591ac515.0 408021025.125f6 629@posting.goo gle.com...[color=green]
            > > How exactly can I go about doing that? I mean what is the syntax for
            > > that option? I've been playing around with If statements and "Do Until
            > > rs.EOF" statements and I keep breaking it....Things work great if the
            > > data is found but if the string that is being searched for is not
            > > found, it crashes...
            > >
            > > "Steven Burn" <pvt@noyb.com > wrote in message[/color]
            > news:<evGbxyZdE HA.2504@TK2MSFT NGP12.phx.gbl>. ..[color=green][color=darkred]
            > > > The error you mentioned means the record thats been requested does not[/color][/color]
            > exist[color=green][color=darkred]
            > > > in the database.
            > > >
            > > > All I do to get past this is use a function that queries the database[/color][/color]
            > for[color=green][color=darkred]
            > > > the record # thats requested, and re-dir to a friendly "stop requesting
            > > > invalid records" page ;o)
            > > >
            > > > --
            > > >
            > > > Regards
            > > >
            > > > Steven Burn
            > > > Ur I.T. Mate Group
            > > > www.it-mate.co.uk
            > > >
            > > > Keeping it FREE!
            > > >
            > > >
            > > > "dmiller234 62" <dmiller23462@y ahoo.com> wrote in message
            > > > news:591ac515.0 407291022.252d5 53a@posting.goo gle.com...
            > > > > My brain is nuked....Can anybody tell me right off the bat what is
            > > > > wrong with this code? Along with any glaring errors, please let me
            > > > > know the syntax to display a message (Response.Write would be fine I
            > > > > think) that will say "I'm sorry but the data you requested cannot be
            > > > > found" or something along those lines....
            > > > >
            > > > > This code is on an archive page I have on my company's intranet....The
            > > > > end result is to show 3 records at a time pulled from an Access DB and
            > > > > display on the screen....If the information IS found, everything seems
            > > > > to work alright but if it's not I get the error msg listed....Inste ad
            > > > > of that error msg I'd like to get the friendly message for the user
            > > > > basically saying "Sorry but your info can't be found" (see
            > > > > above)....Any help/suggestions would be great....I'm fried....In the
            > > > > process of trying to improve my work I broke it....I'm a newbie to ASP
            > > > > so please, hook a brother up with some advice...
            > > > >
            > > > > My error message....
            > > > > *****
            > > > > ADODB.Recordset error '800a0bcd'
            > > > >
            > > > > Either BOF or EOF is True, or the current record has been deleted.
            > > > > Requested operation requires a current record.
            > > > >
            > > > >
            > > >[/color][/color]
            > /jax/wh/Online_Forms/Secured_Archive s/search_files/search_results_ wave.asp,[color=green][color=darkred]
            > > > > line 57
            > > > > *****
            > > > >
            > > > > My code from search_results_ wave.asp....
            > > > > *****
            > > > > <!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->
            > > > >
            > > > > <%
            > > > >
            > > > > Mode = request.form("m ode")
            > > > > Name = request.form("n ame")
            > > > > Shift = request.form("s hift")
            > > > > Wave = request.form("w ave")
            > > > > Carton = request.form("c arton")
            > > > > Location = request.form("l ocation")
            > > > > License = request.form("l icense")
            > > > > Sku = request.form("s ku")
            > > > > Qty = request.form("q uantity")
            > > > > Reason = request.form("r eason")
            > > > > Comments = request.form("c omments")
            > > > > waveyear = request.form("w aveyear")
            > > > > wavemonth = request.form("w avemonth")
            > > > > waveday = request.form("w aveday")
            > > > > wavenumber = request.form("w avenumber")
            > > > >
            > > > >
            > > >[/color][/color]
            > '************** *************** *************** *************** *************** *[color=green][color=darkred]
            > > > **
            > > > > '* DATABASE APPENDING
            > > > > *
            > > > >
            > > >[/color][/color]
            > '************** *************** *************** *************** *************** *[color=green][color=darkred]
            > > > **
            > > > > If IsEmpty (Request.QueryS tring("pageNum" )) Then
            > > > > curPage = 1
            > > > > Else
            > > > > curPage = CInt(Request.Qu eryString("page Num"))
            > > > > End If
            > > > >
            > > > > 'create db connection
            > > > > Set dbconn = Server.CreateOb ject("ADODB.Con nection")
            > > > >
            > > > > 'open db in a DSN-less method
            > > > > dbconn.Open "PROVIDER=MICRO SOFT.JET.OLEDB. 4.0;DATA SOURCE="&
            > > > >
            > > >[/color][/color]
            > Server.MapPath( "/jax/wh/Online_Forms/Secured_Archive s/search_files/shortage.[color=green][color=darkred]
            > > > mdb")
            > > > >
            > > > > 'create recordset object
            > > > > Set rs = Server.CreateOb ject("ADODB.Rec ordset")
            > > > >
            > > > > 'specify more info about rs
            > > > > rs.CursorLocati on = 3
            > > > > rs.CursorType = 3
            > > > > rs.PageSize = 3
            > > > > rs.open "shortage", dbconn
            > > > >
            > > > > 'sql statement to return input values drawn from html fields within
            > > > > previous week
            > > > > SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear& wavemonth&
            > > > > waveday& wavenumber&"'"
            > > > >
            > > > > 'display results of statement on screen for testing purposes
            > > > > Response.Write "<h3><b><u> " & (SQLqry) & "</u></b></h3><br>"
            > > > >
            > > > > 'execute SQL statement
            > > > > 'Set db = dbconn.Execute( SQLqry)
            > > > >
            > > > > rs.Close
            > > > > rs.Open SQLqry
            > > > >
            > > > > rs.AbsolutePage = curPage
            > > > > Response.Write "<p>You are on page: " & curPage & " of " &
            > > > > rs.PageCount
            > > > > Response.Write "<br>"
            > > > > Response.Write "<br>"
            > > > >
            > > > > For i = 1 to rs.PageSize
            > > > > If rs.EOF Then Exit For
            > > > > Response.Write "<b>Name :</b> " & rs("name")
            > > > > Response.Write "<br>"
            > > > > Response.Write "<b>Shift :</b> " & rs("shift")
            > > > > Response.Write "<br>"
            > > > > Response.Write "<b>Wave Number :</b> " & rs("wave")
            > > > > Response.Write "<br>"
            > > > > Response.Write "<b>Carton Number :</b> " & rs("carton")
            > > > > Response.Write "<br>"
            > > > > Response.Write "<b>Locatio n :</b> " & rs("location")
            > > > > Response.Write "<br>"
            > > > > Response.Write "<b>License :</b> " & rs("license")
            > > > > Response.Write "<br>"
            > > > > Response.Write "<b>SKU :</b> " & rs("sku")
            > > > > Response.Write "<br>"
            > > > > Response.Write "<b>Quantit y :</b> " & rs("qty")
            > > > > Response.Write "<br>"
            > > > > Response.Write "<b>Reason :</b> " & rs("reason")
            > > > > Response.Write "<br>"
            > > > > Response.Write "<b>Comment s :</b> " & rs("comments")
            > > > > Response.Write "<br>"
            > > > > Response.Write "<b>Date Submitted :</b> " & rs("date")
            > > > > Response.Write "<hr>"
            > > > > rs.MoveNext
            > > > > Next
            > > > >
            > > > > If curPage > 1 then
            > > > > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
            > > > > curPage-1 & "'>Previous </a>"
            > > > > If curPage < rs.PageCount then
            > > > > Response.Write " | "
            > > > > end if
            > > > > end if
            > > > > If curPage < rs.PageCount then
            > > > > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
            > > > > curPage+1 & "'>Next</a>"
            > > > > end if
            > > > >
            > > > > 'close recordset
            > > > > rs.Close
            > > > >
            > > > > 'zero out recordset object
            > > > > Set rs = Nothing
            > > > >
            > > > > 'smack around the db connection until it lets go
            > > > > dbconn.Close
            > > > >
            > > > > 'terminate db connection with extreme prejudice
            > > > > set dbconn = nothing
            > > > >
            > > > > %>
            > > > >
            > > > > <br><a href="../Archives.asp">R eturn to Archives</a>
            > > > > <br><a href="../../Shortage.asp">R eturn to Shortage Submission
            > > > > Form</a>
            > > > > <br><a href="../../../default.asp">Re turn to Warehouse
            > > > > Operations</a><!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->
            > > > > *****[/color][/color][/color]

            Comment

            • Aaron [SQL Server MVP]

              #7
              Re: Recordset Errors / Friendly Message needed

              UGH. No wonder your brain is nuked.

              Let's start here. What is the RESULT of:

              'display results of statement on screen for testing purposes
              Response.Write "<h3><b><u> " & (SQLqry) & "</u></b></h3><br>"

              It's great to see that you are attempting to perform some debugging, but
              unless you show us what that produced, there's not much we can do.

              --

              (Reverse address to reply.)


              Comment

              • Steven Burn

                #8
                Re: Recordset Errors / Friendly Message needed

                Just a guess but, I'd say the problem is your using the following;

                SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear& wavemonth&
                waveday& wavenumber&"'"

                Instead of first checking that the record actually exists....... (you need
                to check the record actually exists, BEFORE it gets to this line)

                i.e.

                If RecordExists(Re quest.Querystri ng("Whatever") ) Then
                '// Your code goes here.....
                Else
                Response.Write "No record found"
                Response.End
                End if

                I'd also advise not using "Select * FROM" and instead using "Select <table
                names> FROM" (there's an ASPFAQ article on it somewhere concerning the why's
                and why not's)

                --

                Regards

                Steven Burn
                Ur I.T. Mate Group


                Keeping it FREE!


                "dmiller234 62" <dmiller23462@y ahoo.com> wrote in message
                news:591ac515.0 408030657.146fe 5cb@posting.goo gle.com...[color=blue]
                > I have inserted my own variables into this code and still no luck....I
                > kept getting an error message that it an object was
                > required....Tra cking it down to the line containing "rs.Open SQLqry" I
                > think it's because my first mention of the recordset variable "rs" is
                > within the "Function RecordExists(sI D)" code...I've tried opening and
                > closing it OUTSIDE of the function and it's not working....Once again,
                > I'm a bit frazzled (still new to me) and this is the code I currently
                > have...
                >
                > I took the code OUTSIDE of the function....Pro bably not a good idea
                > but that was part of my experimenting.. ..Take a look and then e-slap
                > me...
                > *****
                > <%
                >
                > Mode = request.form("m ode")
                > Name = request.form("n ame")
                > Shift = request.form("s hift")
                > Wave = request.form("w ave")
                > Carton = request.form("c arton")
                > Location = request.form("l ocation")
                > License = request.form("l icense")
                > Sku = request.form("s ku")
                > Qty = request.form("q uantity")
                > Reason = request.form("r eason")
                > Comments = request.form("c omments")
                > waveyear = request.form("w aveyear")
                > wavemonth = request.form("w avemonth")
                > waveday = request.form("w aveday")
                > wavenumber = request.form("w avenumber")
                > entirewave = request.form("w aveyear") & request.form("w avemonth") &
                > request.form("w aveday") & request.form("w avenumber")
                >
                >[/color]
                '************** *************** *************** *************** *************** *
                **[color=blue]
                > '* DATABASE APPENDING
                > *
                >[/color]
                '************** *************** *************** *************** *************** *
                **[color=blue]
                > 'create db connection
                > Set dbconn = Server.CreateOb ject("ADODB.Con nection")
                > dbconn.Mode = adModeReadWrite
                >
                > 'open db in a DSN-less method
                > dbconn.Open "PROVIDER=MICRO SOFT.JET.OLEDB. 4.0;DATA SOURCE="&
                >[/color]
                Server.MapPath( "/jax/wh/Online_Forms/Secured_Archive s/search_files/shortage.
                mdb")[color=blue]
                >
                > Set rs = Server.CreateOb ject("ADODB.Rec ordset")
                > rs.CursorLocati on = 3
                > rs.CursorType = 3
                > rs.PageSize = 3
                > rs.open "shortage", dbconn
                >
                > Do While Not rs.eof
                > If CLng(entirewave )=Null Then
                > RecordExists = false
                > Exit Do
                > End If
                > rs.Movenext
                > Loop
                > rs.Close
                >
                > If IsEmpty (Request.QueryS tring("pageNum" )) Then
                > curPage = 1
                > Else
                > curPage = CInt(Request.Qu eryString("page Num"))
                > End If
                >
                > 'create recordset object
                > Set rs = Server.CreateOb ject("ADODB.Rec ordset")
                >
                > 'sql statement to return input values drawn from html fields within
                > previous week
                > SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear& wavemonth&
                > waveday& wavenumber&"'"
                >
                > 'display results of statement on screen for testing purposes
                > Response.Write "<h3><b><u> " & (SQLqry) & "</u></b></h3><br>"
                >
                > rs.Open SQLqry
                >
                > rs.AbsolutePage = curPage
                > Response.Write "<p>You are on page: " & curPage & " of " &
                > rs.PageCount
                > Response.Write "<br>"
                > Response.Write "<br>"
                >
                > For i = 1 to rs.PageSize
                > If rs.EOF Then Exit For
                > Response.Write "<b>Name :</b> " & rs("name")
                > Response.Write "<br>"
                > Response.Write "<b>Shift :</b> " & rs("shift")
                > Response.Write "<br>"
                > Response.Write "<b>Wave Number :</b> " & rs("wave")
                > Response.Write "<br>"
                > Response.Write "<b>Carton Number :</b> " & rs("carton")
                > Response.Write "<br>"
                > Response.Write "<b>Locatio n :</b> " & rs("location")
                > Response.Write "<br>"
                > Response.Write "<b>License :</b> " & rs("license")
                > Response.Write "<br>"
                > Response.Write "<b>SKU :</b> " & rs("sku")
                > Response.Write "<br>"
                > Response.Write "<b>Quantit y :</b> " & rs("qty")
                > Response.Write "<br>"
                > Response.Write "<b>Reason :</b> " & rs("reason")
                > Response.Write "<br>"
                > Response.Write "<b>Comment s :</b> " & rs("comments")
                > Response.Write "<br>"
                > Response.Write "<b>Date Submitted :</b> " & rs("date")
                > Response.Write "<hr>"
                > rs.MoveNext
                > Next
                >
                >
                > If curPage > 1 then
                > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
                > curPage-1 & "'>Previous </a>"
                > If curPage < rs.PageCount then
                > Response.Write " | "
                > end if
                > end if
                > If curPage < rs.PageCount then
                > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
                > curPage+1 & "'>Next</a>"
                > end if
                >
                > 'close recordset
                > rs.Close
                >
                > 'zero out recordset object
                > Set rs = Nothing
                >
                > 'smack around the db connection until it lets go
                > dbconn.Close
                >
                > 'terminate db connection with extreme prejudice
                > set dbconn = nothing
                > %>
                >
                > *****
                >
                >
                > "Steven Burn" <pvt@noyb.com > wrote in message[/color]
                news:<#1dM2FMeE HA.3792@TK2MSFT NGP09.phx.gbl>. ..[color=blue][color=green]
                > > '// Replace the_database.md b with the filename of your database
                > > Const objDB = "the_Database.m db"
                > >
                > > Function ConnectToDB(dbP ath)
                > > '// The code you use to connect to your database goes here
                > > Set DB = Server.Createob ject("ADODB.Con nection")
                > > DB.Mode = adModeReadWrite
                > > DB.Open ("PROVIDER=Micr osoft.Jet.OLEDB .4.0;DATA SOURCE=" +
                > > Server.MapPath( dbPath))
                > > Set ConnectToDB = DB
                > > End Function
                > >
                > > Function RecordExists(sI D)
                > > Set DB = ConnectToDB(obj DB)
                > > Set rst = Server.CreateOb ject("ADODB.Rec ordset")
                > > rst.open "Select ID from tblSomeTable", DB, adOpenStatic,[/color][/color]
                adLockReadOnly[color=blue][color=green]
                > > Do While Not rst.eof
                > > If CLng(rst("ID")) =CLng(sID) Then
                > > RecordExists = true
                > > Exit Do
                > > End If
                > > rst.Movenext
                > > Loop
                > > End Function
                > >
                > > --
                > >
                > > Regards
                > >
                > > Steven Burn
                > > Ur I.T. Mate Group
                > > www.it-mate.co.uk
                > >
                > > Keeping it FREE!
                > >
                > >
                > > "dmiller234 62" <dmiller23462@y ahoo.com> wrote in message
                > > news:591ac515.0 408021025.125f6 629@posting.goo gle.com...[color=darkred]
                > > > How exactly can I go about doing that? I mean what is the syntax for
                > > > that option? I've been playing around with If statements and "Do Until
                > > > rs.EOF" statements and I keep breaking it....Things work great if the
                > > > data is found but if the string that is being searched for is not
                > > > found, it crashes...
                > > >
                > > > "Steven Burn" <pvt@noyb.com > wrote in message[/color]
                > > news:<evGbxyZdE HA.2504@TK2MSFT NGP12.phx.gbl>. ..[color=darkred]
                > > > > The error you mentioned means the record thats been requested does[/color][/color][/color]
                not[color=blue][color=green]
                > > exist[color=darkred]
                > > > > in the database.
                > > > >
                > > > > All I do to get past this is use a function that queries the[/color][/color][/color]
                database[color=blue][color=green]
                > > for[color=darkred]
                > > > > the record # thats requested, and re-dir to a friendly "stop[/color][/color][/color]
                requesting[color=blue][color=green][color=darkred]
                > > > > invalid records" page ;o)
                > > > >
                > > > > --
                > > > >
                > > > > Regards
                > > > >
                > > > > Steven Burn
                > > > > Ur I.T. Mate Group
                > > > > www.it-mate.co.uk
                > > > >
                > > > > Keeping it FREE!
                > > > >
                > > > >
                > > > > "dmiller234 62" <dmiller23462@y ahoo.com> wrote in message
                > > > > news:591ac515.0 407291022.252d5 53a@posting.goo gle.com...
                > > > > > My brain is nuked....Can anybody tell me right off the bat what is
                > > > > > wrong with this code? Along with any glaring errors, please let me
                > > > > > know the syntax to display a message (Response.Write would be fine[/color][/color][/color]
                I[color=blue][color=green][color=darkred]
                > > > > > think) that will say "I'm sorry but the data you requested cannot[/color][/color][/color]
                be[color=blue][color=green][color=darkred]
                > > > > > found" or something along those lines....
                > > > > >
                > > > > > This code is on an archive page I have on my company's[/color][/color][/color]
                intranet....The[color=blue][color=green][color=darkred]
                > > > > > end result is to show 3 records at a time pulled from an Access DB[/color][/color][/color]
                and[color=blue][color=green][color=darkred]
                > > > > > display on the screen....If the information IS found, everything[/color][/color][/color]
                seems[color=blue][color=green][color=darkred]
                > > > > > to work alright but if it's not I get the error msg[/color][/color][/color]
                listed....Inste ad[color=blue][color=green][color=darkred]
                > > > > > of that error msg I'd like to get the friendly message for the[/color][/color][/color]
                user[color=blue][color=green][color=darkred]
                > > > > > basically saying "Sorry but your info can't be found" (see
                > > > > > above)....Any help/suggestions would be great....I'm fried....In[/color][/color][/color]
                the[color=blue][color=green][color=darkred]
                > > > > > process of trying to improve my work I broke it....I'm a newbie to[/color][/color][/color]
                ASP[color=blue][color=green][color=darkred]
                > > > > > so please, hook a brother up with some advice...
                > > > > >
                > > > > > My error message....
                > > > > > *****
                > > > > > ADODB.Recordset error '800a0bcd'
                > > > > >
                > > > > > Either BOF or EOF is True, or the current record has been deleted.
                > > > > > Requested operation requires a current record.
                > > > > >
                > > > > >
                > > > >[/color]
                > >[/color][/color]
                /jax/wh/Online_Forms/Secured_Archive s/search_files/search_results_ wave.asp,[color=blue][color=green][color=darkred]
                > > > > > line 57
                > > > > > *****
                > > > > >
                > > > > > My code from search_results_ wave.asp....
                > > > > > *****
                > > > > > <!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->
                > > > > >
                > > > > > <%
                > > > > >
                > > > > > Mode = request.form("m ode")
                > > > > > Name = request.form("n ame")
                > > > > > Shift = request.form("s hift")
                > > > > > Wave = request.form("w ave")
                > > > > > Carton = request.form("c arton")
                > > > > > Location = request.form("l ocation")
                > > > > > License = request.form("l icense")
                > > > > > Sku = request.form("s ku")
                > > > > > Qty = request.form("q uantity")
                > > > > > Reason = request.form("r eason")
                > > > > > Comments = request.form("c omments")
                > > > > > waveyear = request.form("w aveyear")
                > > > > > wavemonth = request.form("w avemonth")
                > > > > > waveday = request.form("w aveday")
                > > > > > wavenumber = request.form("w avenumber")
                > > > > >
                > > > > >
                > > > >[/color]
                > >[/color][/color]
                '************** *************** *************** *************** *************** *[color=blue][color=green][color=darkred]
                > > > > **
                > > > > > '* DATABASE APPENDING
                > > > > > *
                > > > > >
                > > > >[/color]
                > >[/color][/color]
                '************** *************** *************** *************** *************** *[color=blue][color=green][color=darkred]
                > > > > **
                > > > > > If IsEmpty (Request.QueryS tring("pageNum" )) Then
                > > > > > curPage = 1
                > > > > > Else
                > > > > > curPage = CInt(Request.Qu eryString("page Num"))
                > > > > > End If
                > > > > >
                > > > > > 'create db connection
                > > > > > Set dbconn = Server.CreateOb ject("ADODB.Con nection")
                > > > > >
                > > > > > 'open db in a DSN-less method
                > > > > > dbconn.Open "PROVIDER=MICRO SOFT.JET.OLEDB. 4.0;DATA SOURCE="&
                > > > > >
                > > > >[/color]
                > >[/color][/color]
                Server.MapPath( "/jax/wh/Online_Forms/Secured_Archive s/search_files/shortage.[color=blue][color=green][color=darkred]
                > > > > mdb")
                > > > > >
                > > > > > 'create recordset object
                > > > > > Set rs = Server.CreateOb ject("ADODB.Rec ordset")
                > > > > >
                > > > > > 'specify more info about rs
                > > > > > rs.CursorLocati on = 3
                > > > > > rs.CursorType = 3
                > > > > > rs.PageSize = 3
                > > > > > rs.open "shortage", dbconn
                > > > > >
                > > > > > 'sql statement to return input values drawn from html fields[/color][/color][/color]
                within[color=blue][color=green][color=darkred]
                > > > > > previous week
                > > > > > SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear&[/color][/color][/color]
                wavemonth&[color=blue][color=green][color=darkred]
                > > > > > waveday& wavenumber&"'"
                > > > > >
                > > > > > 'display results of statement on screen for testing purposes
                > > > > > Response.Write "<h3><b><u> " & (SQLqry) & "</u></b></h3><br>"
                > > > > >
                > > > > > 'execute SQL statement
                > > > > > 'Set db = dbconn.Execute( SQLqry)
                > > > > >
                > > > > > rs.Close
                > > > > > rs.Open SQLqry
                > > > > >
                > > > > > rs.AbsolutePage = curPage
                > > > > > Response.Write "<p>You are on page: " & curPage & " of " &
                > > > > > rs.PageCount
                > > > > > Response.Write "<br>"
                > > > > > Response.Write "<br>"
                > > > > >
                > > > > > For i = 1 to rs.PageSize
                > > > > > If rs.EOF Then Exit For
                > > > > > Response.Write "<b>Name :</b> " & rs("name")
                > > > > > Response.Write "<br>"
                > > > > > Response.Write "<b>Shift :</b> " & rs("shift")
                > > > > > Response.Write "<br>"
                > > > > > Response.Write "<b>Wave Number :</b> " & rs("wave")
                > > > > > Response.Write "<br>"
                > > > > > Response.Write "<b>Carton Number :</b> " & rs("carton")
                > > > > > Response.Write "<br>"
                > > > > > Response.Write "<b>Locatio n :</b> " & rs("location")
                > > > > > Response.Write "<br>"
                > > > > > Response.Write "<b>License :</b> " & rs("license")
                > > > > > Response.Write "<br>"
                > > > > > Response.Write "<b>SKU :</b> " & rs("sku")
                > > > > > Response.Write "<br>"
                > > > > > Response.Write "<b>Quantit y :</b> " & rs("qty")
                > > > > > Response.Write "<br>"
                > > > > > Response.Write "<b>Reason :</b> " & rs("reason")
                > > > > > Response.Write "<br>"
                > > > > > Response.Write "<b>Comment s :</b> " & rs("comments")
                > > > > > Response.Write "<br>"
                > > > > > Response.Write "<b>Date Submitted :</b> " & rs("date")
                > > > > > Response.Write "<hr>"
                > > > > > rs.MoveNext
                > > > > > Next
                > > > > >
                > > > > > If curPage > 1 then
                > > > > > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
                > > > > > curPage-1 & "'>Previous </a>"
                > > > > > If curPage < rs.PageCount then
                > > > > > Response.Write " | "
                > > > > > end if
                > > > > > end if
                > > > > > If curPage < rs.PageCount then
                > > > > > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
                > > > > > curPage+1 & "'>Next</a>"
                > > > > > end if
                > > > > >
                > > > > > 'close recordset
                > > > > > rs.Close
                > > > > >
                > > > > > 'zero out recordset object
                > > > > > Set rs = Nothing
                > > > > >
                > > > > > 'smack around the db connection until it lets go
                > > > > > dbconn.Close
                > > > > >
                > > > > > 'terminate db connection with extreme prejudice
                > > > > > set dbconn = nothing
                > > > > >
                > > > > > %>
                > > > > >
                > > > > > <br><a href="../Archives.asp">R eturn to Archives</a>
                > > > > > <br><a href="../../Shortage.asp">R eturn to Shortage Submission
                > > > > > Form</a>
                > > > > > <br><a href="../../../default.asp">Re turn to Warehouse
                > > > > > Operations</a><!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->
                > > > > > *****[/color][/color][/color]


                Comment

                • Steven Burn

                  #9
                  Re: Recordset Errors / Friendly Message needed

                  Couple references for you ;o)

                  What is wrong with 'SELECT *'?


                  Why do I get 'BOF or EOF' errors?


                  --

                  Regards

                  Steven Burn
                  Ur I.T. Mate Group


                  Keeping it FREE!


                  "dmiller234 62" <dmiller23462@y ahoo.com> wrote in message
                  news:591ac515.0 408030657.146fe 5cb@posting.goo gle.com...[color=blue]
                  > I have inserted my own variables into this code and still no luck....I
                  > kept getting an error message that it an object was
                  > required....Tra cking it down to the line containing "rs.Open SQLqry" I
                  > think it's because my first mention of the recordset variable "rs" is
                  > within the "Function RecordExists(sI D)" code...I've tried opening and
                  > closing it OUTSIDE of the function and it's not working....Once again,
                  > I'm a bit frazzled (still new to me) and this is the code I currently
                  > have...
                  >
                  > I took the code OUTSIDE of the function....Pro bably not a good idea
                  > but that was part of my experimenting.. ..Take a look and then e-slap
                  > me...
                  > *****
                  > <%
                  >
                  > Mode = request.form("m ode")
                  > Name = request.form("n ame")
                  > Shift = request.form("s hift")
                  > Wave = request.form("w ave")
                  > Carton = request.form("c arton")
                  > Location = request.form("l ocation")
                  > License = request.form("l icense")
                  > Sku = request.form("s ku")
                  > Qty = request.form("q uantity")
                  > Reason = request.form("r eason")
                  > Comments = request.form("c omments")
                  > waveyear = request.form("w aveyear")
                  > wavemonth = request.form("w avemonth")
                  > waveday = request.form("w aveday")
                  > wavenumber = request.form("w avenumber")
                  > entirewave = request.form("w aveyear") & request.form("w avemonth") &
                  > request.form("w aveday") & request.form("w avenumber")
                  >
                  >[/color]
                  '************** *************** *************** *************** *************** *
                  **[color=blue]
                  > '* DATABASE APPENDING
                  > *
                  >[/color]
                  '************** *************** *************** *************** *************** *
                  **[color=blue]
                  > 'create db connection
                  > Set dbconn = Server.CreateOb ject("ADODB.Con nection")
                  > dbconn.Mode = adModeReadWrite
                  >
                  > 'open db in a DSN-less method
                  > dbconn.Open "PROVIDER=MICRO SOFT.JET.OLEDB. 4.0;DATA SOURCE="&
                  >[/color]
                  Server.MapPath( "/jax/wh/Online_Forms/Secured_Archive s/search_files/shortage.
                  mdb")[color=blue]
                  >
                  > Set rs = Server.CreateOb ject("ADODB.Rec ordset")
                  > rs.CursorLocati on = 3
                  > rs.CursorType = 3
                  > rs.PageSize = 3
                  > rs.open "shortage", dbconn
                  >
                  > Do While Not rs.eof
                  > If CLng(entirewave )=Null Then
                  > RecordExists = false
                  > Exit Do
                  > End If
                  > rs.Movenext
                  > Loop
                  > rs.Close
                  >
                  > If IsEmpty (Request.QueryS tring("pageNum" )) Then
                  > curPage = 1
                  > Else
                  > curPage = CInt(Request.Qu eryString("page Num"))
                  > End If
                  >
                  > 'create recordset object
                  > Set rs = Server.CreateOb ject("ADODB.Rec ordset")
                  >
                  > 'sql statement to return input values drawn from html fields within
                  > previous week
                  > SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear& wavemonth&
                  > waveday& wavenumber&"'"
                  >
                  > 'display results of statement on screen for testing purposes
                  > Response.Write "<h3><b><u> " & (SQLqry) & "</u></b></h3><br>"
                  >
                  > rs.Open SQLqry
                  >
                  > rs.AbsolutePage = curPage
                  > Response.Write "<p>You are on page: " & curPage & " of " &
                  > rs.PageCount
                  > Response.Write "<br>"
                  > Response.Write "<br>"
                  >
                  > For i = 1 to rs.PageSize
                  > If rs.EOF Then Exit For
                  > Response.Write "<b>Name :</b> " & rs("name")
                  > Response.Write "<br>"
                  > Response.Write "<b>Shift :</b> " & rs("shift")
                  > Response.Write "<br>"
                  > Response.Write "<b>Wave Number :</b> " & rs("wave")
                  > Response.Write "<br>"
                  > Response.Write "<b>Carton Number :</b> " & rs("carton")
                  > Response.Write "<br>"
                  > Response.Write "<b>Locatio n :</b> " & rs("location")
                  > Response.Write "<br>"
                  > Response.Write "<b>License :</b> " & rs("license")
                  > Response.Write "<br>"
                  > Response.Write "<b>SKU :</b> " & rs("sku")
                  > Response.Write "<br>"
                  > Response.Write "<b>Quantit y :</b> " & rs("qty")
                  > Response.Write "<br>"
                  > Response.Write "<b>Reason :</b> " & rs("reason")
                  > Response.Write "<br>"
                  > Response.Write "<b>Comment s :</b> " & rs("comments")
                  > Response.Write "<br>"
                  > Response.Write "<b>Date Submitted :</b> " & rs("date")
                  > Response.Write "<hr>"
                  > rs.MoveNext
                  > Next
                  >
                  >
                  > If curPage > 1 then
                  > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
                  > curPage-1 & "'>Previous </a>"
                  > If curPage < rs.PageCount then
                  > Response.Write " | "
                  > end if
                  > end if
                  > If curPage < rs.PageCount then
                  > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
                  > curPage+1 & "'>Next</a>"
                  > end if
                  >
                  > 'close recordset
                  > rs.Close
                  >
                  > 'zero out recordset object
                  > Set rs = Nothing
                  >
                  > 'smack around the db connection until it lets go
                  > dbconn.Close
                  >
                  > 'terminate db connection with extreme prejudice
                  > set dbconn = nothing
                  > %>
                  >
                  > *****
                  >
                  >
                  > "Steven Burn" <pvt@noyb.com > wrote in message[/color]
                  news:<#1dM2FMeE HA.3792@TK2MSFT NGP09.phx.gbl>. ..[color=blue][color=green]
                  > > '// Replace the_database.md b with the filename of your database
                  > > Const objDB = "the_Database.m db"
                  > >
                  > > Function ConnectToDB(dbP ath)
                  > > '// The code you use to connect to your database goes here
                  > > Set DB = Server.Createob ject("ADODB.Con nection")
                  > > DB.Mode = adModeReadWrite
                  > > DB.Open ("PROVIDER=Micr osoft.Jet.OLEDB .4.0;DATA SOURCE=" +
                  > > Server.MapPath( dbPath))
                  > > Set ConnectToDB = DB
                  > > End Function
                  > >
                  > > Function RecordExists(sI D)
                  > > Set DB = ConnectToDB(obj DB)
                  > > Set rst = Server.CreateOb ject("ADODB.Rec ordset")
                  > > rst.open "Select ID from tblSomeTable", DB, adOpenStatic,[/color][/color]
                  adLockReadOnly[color=blue][color=green]
                  > > Do While Not rst.eof
                  > > If CLng(rst("ID")) =CLng(sID) Then
                  > > RecordExists = true
                  > > Exit Do
                  > > End If
                  > > rst.Movenext
                  > > Loop
                  > > End Function
                  > >
                  > > --
                  > >
                  > > Regards
                  > >
                  > > Steven Burn
                  > > Ur I.T. Mate Group
                  > > www.it-mate.co.uk
                  > >
                  > > Keeping it FREE!
                  > >
                  > >
                  > > "dmiller234 62" <dmiller23462@y ahoo.com> wrote in message
                  > > news:591ac515.0 408021025.125f6 629@posting.goo gle.com...[color=darkred]
                  > > > How exactly can I go about doing that? I mean what is the syntax for
                  > > > that option? I've been playing around with If statements and "Do Until
                  > > > rs.EOF" statements and I keep breaking it....Things work great if the
                  > > > data is found but if the string that is being searched for is not
                  > > > found, it crashes...
                  > > >
                  > > > "Steven Burn" <pvt@noyb.com > wrote in message[/color]
                  > > news:<evGbxyZdE HA.2504@TK2MSFT NGP12.phx.gbl>. ..[color=darkred]
                  > > > > The error you mentioned means the record thats been requested does[/color][/color][/color]
                  not[color=blue][color=green]
                  > > exist[color=darkred]
                  > > > > in the database.
                  > > > >
                  > > > > All I do to get past this is use a function that queries the[/color][/color][/color]
                  database[color=blue][color=green]
                  > > for[color=darkred]
                  > > > > the record # thats requested, and re-dir to a friendly "stop[/color][/color][/color]
                  requesting[color=blue][color=green][color=darkred]
                  > > > > invalid records" page ;o)
                  > > > >
                  > > > > --
                  > > > >
                  > > > > Regards
                  > > > >
                  > > > > Steven Burn
                  > > > > Ur I.T. Mate Group
                  > > > > www.it-mate.co.uk
                  > > > >
                  > > > > Keeping it FREE!
                  > > > >
                  > > > >
                  > > > > "dmiller234 62" <dmiller23462@y ahoo.com> wrote in message
                  > > > > news:591ac515.0 407291022.252d5 53a@posting.goo gle.com...
                  > > > > > My brain is nuked....Can anybody tell me right off the bat what is
                  > > > > > wrong with this code? Along with any glaring errors, please let me
                  > > > > > know the syntax to display a message (Response.Write would be fine[/color][/color][/color]
                  I[color=blue][color=green][color=darkred]
                  > > > > > think) that will say "I'm sorry but the data you requested cannot[/color][/color][/color]
                  be[color=blue][color=green][color=darkred]
                  > > > > > found" or something along those lines....
                  > > > > >
                  > > > > > This code is on an archive page I have on my company's[/color][/color][/color]
                  intranet....The[color=blue][color=green][color=darkred]
                  > > > > > end result is to show 3 records at a time pulled from an Access DB[/color][/color][/color]
                  and[color=blue][color=green][color=darkred]
                  > > > > > display on the screen....If the information IS found, everything[/color][/color][/color]
                  seems[color=blue][color=green][color=darkred]
                  > > > > > to work alright but if it's not I get the error msg[/color][/color][/color]
                  listed....Inste ad[color=blue][color=green][color=darkred]
                  > > > > > of that error msg I'd like to get the friendly message for the[/color][/color][/color]
                  user[color=blue][color=green][color=darkred]
                  > > > > > basically saying "Sorry but your info can't be found" (see
                  > > > > > above)....Any help/suggestions would be great....I'm fried....In[/color][/color][/color]
                  the[color=blue][color=green][color=darkred]
                  > > > > > process of trying to improve my work I broke it....I'm a newbie to[/color][/color][/color]
                  ASP[color=blue][color=green][color=darkred]
                  > > > > > so please, hook a brother up with some advice...
                  > > > > >
                  > > > > > My error message....
                  > > > > > *****
                  > > > > > ADODB.Recordset error '800a0bcd'
                  > > > > >
                  > > > > > Either BOF or EOF is True, or the current record has been deleted.
                  > > > > > Requested operation requires a current record.
                  > > > > >
                  > > > > >
                  > > > >[/color]
                  > >[/color][/color]
                  /jax/wh/Online_Forms/Secured_Archive s/search_files/search_results_ wave.asp,[color=blue][color=green][color=darkred]
                  > > > > > line 57
                  > > > > > *****
                  > > > > >
                  > > > > > My code from search_results_ wave.asp....
                  > > > > > *****
                  > > > > > <!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->
                  > > > > >
                  > > > > > <%
                  > > > > >
                  > > > > > Mode = request.form("m ode")
                  > > > > > Name = request.form("n ame")
                  > > > > > Shift = request.form("s hift")
                  > > > > > Wave = request.form("w ave")
                  > > > > > Carton = request.form("c arton")
                  > > > > > Location = request.form("l ocation")
                  > > > > > License = request.form("l icense")
                  > > > > > Sku = request.form("s ku")
                  > > > > > Qty = request.form("q uantity")
                  > > > > > Reason = request.form("r eason")
                  > > > > > Comments = request.form("c omments")
                  > > > > > waveyear = request.form("w aveyear")
                  > > > > > wavemonth = request.form("w avemonth")
                  > > > > > waveday = request.form("w aveday")
                  > > > > > wavenumber = request.form("w avenumber")
                  > > > > >
                  > > > > >
                  > > > >[/color]
                  > >[/color][/color]
                  '************** *************** *************** *************** *************** *[color=blue][color=green][color=darkred]
                  > > > > **
                  > > > > > '* DATABASE APPENDING
                  > > > > > *
                  > > > > >
                  > > > >[/color]
                  > >[/color][/color]
                  '************** *************** *************** *************** *************** *[color=blue][color=green][color=darkred]
                  > > > > **
                  > > > > > If IsEmpty (Request.QueryS tring("pageNum" )) Then
                  > > > > > curPage = 1
                  > > > > > Else
                  > > > > > curPage = CInt(Request.Qu eryString("page Num"))
                  > > > > > End If
                  > > > > >
                  > > > > > 'create db connection
                  > > > > > Set dbconn = Server.CreateOb ject("ADODB.Con nection")
                  > > > > >
                  > > > > > 'open db in a DSN-less method
                  > > > > > dbconn.Open "PROVIDER=MICRO SOFT.JET.OLEDB. 4.0;DATA SOURCE="&
                  > > > > >
                  > > > >[/color]
                  > >[/color][/color]
                  Server.MapPath( "/jax/wh/Online_Forms/Secured_Archive s/search_files/shortage.[color=blue][color=green][color=darkred]
                  > > > > mdb")
                  > > > > >
                  > > > > > 'create recordset object
                  > > > > > Set rs = Server.CreateOb ject("ADODB.Rec ordset")
                  > > > > >
                  > > > > > 'specify more info about rs
                  > > > > > rs.CursorLocati on = 3
                  > > > > > rs.CursorType = 3
                  > > > > > rs.PageSize = 3
                  > > > > > rs.open "shortage", dbconn
                  > > > > >
                  > > > > > 'sql statement to return input values drawn from html fields[/color][/color][/color]
                  within[color=blue][color=green][color=darkred]
                  > > > > > previous week
                  > > > > > SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear&[/color][/color][/color]
                  wavemonth&[color=blue][color=green][color=darkred]
                  > > > > > waveday& wavenumber&"'"
                  > > > > >
                  > > > > > 'display results of statement on screen for testing purposes
                  > > > > > Response.Write "<h3><b><u> " & (SQLqry) & "</u></b></h3><br>"
                  > > > > >
                  > > > > > 'execute SQL statement
                  > > > > > 'Set db = dbconn.Execute( SQLqry)
                  > > > > >
                  > > > > > rs.Close
                  > > > > > rs.Open SQLqry
                  > > > > >
                  > > > > > rs.AbsolutePage = curPage
                  > > > > > Response.Write "<p>You are on page: " & curPage & " of " &
                  > > > > > rs.PageCount
                  > > > > > Response.Write "<br>"
                  > > > > > Response.Write "<br>"
                  > > > > >
                  > > > > > For i = 1 to rs.PageSize
                  > > > > > If rs.EOF Then Exit For
                  > > > > > Response.Write "<b>Name :</b> " & rs("name")
                  > > > > > Response.Write "<br>"
                  > > > > > Response.Write "<b>Shift :</b> " & rs("shift")
                  > > > > > Response.Write "<br>"
                  > > > > > Response.Write "<b>Wave Number :</b> " & rs("wave")
                  > > > > > Response.Write "<br>"
                  > > > > > Response.Write "<b>Carton Number :</b> " & rs("carton")
                  > > > > > Response.Write "<br>"
                  > > > > > Response.Write "<b>Locatio n :</b> " & rs("location")
                  > > > > > Response.Write "<br>"
                  > > > > > Response.Write "<b>License :</b> " & rs("license")
                  > > > > > Response.Write "<br>"
                  > > > > > Response.Write "<b>SKU :</b> " & rs("sku")
                  > > > > > Response.Write "<br>"
                  > > > > > Response.Write "<b>Quantit y :</b> " & rs("qty")
                  > > > > > Response.Write "<br>"
                  > > > > > Response.Write "<b>Reason :</b> " & rs("reason")
                  > > > > > Response.Write "<br>"
                  > > > > > Response.Write "<b>Comment s :</b> " & rs("comments")
                  > > > > > Response.Write "<br>"
                  > > > > > Response.Write "<b>Date Submitted :</b> " & rs("date")
                  > > > > > Response.Write "<hr>"
                  > > > > > rs.MoveNext
                  > > > > > Next
                  > > > > >
                  > > > > > If curPage > 1 then
                  > > > > > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
                  > > > > > curPage-1 & "'>Previous </a>"
                  > > > > > If curPage < rs.PageCount then
                  > > > > > Response.Write " | "
                  > > > > > end if
                  > > > > > end if
                  > > > > > If curPage < rs.PageCount then
                  > > > > > Response.Write "<a href='search_re sults_wave.asp? pageNum=" &
                  > > > > > curPage+1 & "'>Next</a>"
                  > > > > > end if
                  > > > > >
                  > > > > > 'close recordset
                  > > > > > rs.Close
                  > > > > >
                  > > > > > 'zero out recordset object
                  > > > > > Set rs = Nothing
                  > > > > >
                  > > > > > 'smack around the db connection until it lets go
                  > > > > > dbconn.Close
                  > > > > >
                  > > > > > 'terminate db connection with extreme prejudice
                  > > > > > set dbconn = nothing
                  > > > > >
                  > > > > > %>
                  > > > > >
                  > > > > > <br><a href="../Archives.asp">R eturn to Archives</a>
                  > > > > > <br><a href="../../Shortage.asp">R eturn to Shortage Submission
                  > > > > > Form</a>
                  > > > > > <br><a href="../../../default.asp">Re turn to Warehouse
                  > > > > > Operations</a><!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->
                  > > > > > *****[/color][/color][/color]


                  Comment

                  Working...