Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Oct 2001
    Location
    Western Massachusetts, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error Trapping (97)

    I'm working on a problem for someone. They want to fill a field in a Table with the database version for each Db in the table. The Table contains a field called Databases which is the complete path to each database. I then wrote some code to fill the field dbVersion with the version number. Works great except if the Db is a newer version than 97(don't ask me why about any of this because I don't know). Now the first time I come across a version newer than 97 I am able to trap the Error ( 3343) and insert the text "Jet Error - New Version" in the field dbVersion. But the second time i come across Error 3343 it will not trap it. In my test data, it is two records in a row. I have added Err.Clear but that doesn't do anything. Anyone have any thoughts. Thanks
    Paul

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Edmonton, Alberta, Canada
    Posts
    326
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error Trapping (97)

    Have you tried turning the error handler back on after handling the error?

  3. #3
    Star Lounger
    Join Date
    Oct 2001
    Location
    Western Massachusetts, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error Trapping (97)

    I'm not sure what you mean. My code is:
    Function FnVersion()
    On Error GoTo JetError
    Bla
    Bla
    Bal
    JetError:
    If Err.Number =3343 Then
    Bla-Bla
    Err.Clear
    End If
    rst.MoveNext
    Loop

    When it hits 3343 the first time it works but how would I turn it back on? Thanks for any help.
    Paul

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Error Trapping (97)

    I got lost in your explanation of storing databases in tables. Are they trying to manage a bunch of databases by storing information about them in still another database?

    Anyhow, you didn't build your error handling correctly, which is why you're only firing it once. Try it this way instead:

    Function FnVersion()
    On Error GoTo JetError
    Bla
    Bla
    Do While Not rst.EOF
    Bal
    rst.MoveNext
    Loop

    Exit function

    JetError:
    If Err.Number =3343 Then
    Resume Next
    Else
    Bla-Bla
    Err.Clear
    End If
    End Function
    Charlotte

  5. #5
    Star Lounger
    Join Date
    Oct 2001
    Location
    Western Massachusetts, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error Trapping (97)

    Thank you Charlotte. I will try it first thing this morning. Error handling isn't one of my strengths. I really don't know why they are storing the paths to databases(the question came up in another forum). I wrote the code to determine the version but they had Db's that were newer than the Db they were storing the paths in so I added a branch to handle the Error. I just didn't handle it properly it seems. I'll let you know how it goes. Thanks again.
    Paul

  6. #6
    Star Lounger
    Join Date
    Oct 2001
    Location
    Western Massachusetts, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error Trapping (97)

    With just minor changes everything works great. Thanks for the help.
    Paul

Posting Permissions

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