Recordset errors 
Author Message
 Recordset errors

The most annoying part about data access in VB is the fact that VB will
stop the program at the slightest hint of trouble, even when such
problems are not even slightly "life-threatening" to the application.

Okay, it's good that VB is so intuitive, but when running for real, a
lot of so called "errors" are just facts of data access life (like
records being temporarily locked). Things like this shouldn't halt
execution of a program, it should merely continue, but return a value
saying that the operation was unsuccessful.

Yet I can't seem to find a way of switching this off (short of putting
On Error Resume Next everywhere, which doens't make debugging easy). The
closest I've got so far, is to create a class object that mimics all the
recordset functions and returns error values instead of stopping the
program.

Does anyone else have any better solutions.

Steven Palmer



Fri, 02 Nov 2001 03:00:00 GMT  
 Recordset errors
you might want something like this.

On Error GoTo DisplayRecErr:

DisplayRecErr:
Select Case Err.Number
    Case 0

    Case Else
        MsgBox "Display Rec Error " & Err.Number & " " & Err.Description
        Resume Next

End Select

Derrick

Quote:

>The most annoying part about data access in VB is the fact that VB will
>stop the program at the slightest hint of trouble, even when such
>problems are not even slightly "life-threatening" to the application.
>Does anyone else have any better solutions.
>Steven Palmer



Fri, 02 Nov 2001 03:00:00 GMT  
 Recordset errors
What about using an error handler?

....
On error GOTO ErrHndlr
....
Exit sub
ErrHndlr:
    Select Case Err
        Case 'whatever err you anticipate
            'get out of whatever loop or tell the user what happened
            'so you can handle groups or single errors
            ....
            err.clear
        Case Else
            MsgBox "An unanticipated error has occurred: " & vbcrlf &
"ERROR#:  " & Err.Number & _
                vbCRLF & Err.Description",
vbInformation,App.Title,Err.HelpFile, Err.HelpContext
            'Comment out the STOP and RESUME before distribution, these will
let you locate the error
            Stop
            Resume
            'Do whatever you want to do with unknown errors, I usually END
the application after writing to a textfile             'the info of the
error, date, and where it happened - I don't usually trust the User for this
            WriteErrorToTextfile
            Err.Clear
            End
    End Select

I hope this helps....

Dean R. LaMana


Quote:
> The most annoying part about data access in VB is the fact that VB will
> stop the program at the slightest hint of trouble, even when such
> problems are not even slightly "life-threatening" to the application.

> Okay, it's good that VB is so intuitive, but when running for real, a
> lot of so called "errors" are just facts of data access life (like
> records being temporarily locked). Things like this shouldn't halt
> execution of a program, it should merely continue, but return a value
> saying that the operation was unsuccessful.

> Yet I can't seem to find a way of switching this off (short of putting
> On Error Resume Next everywhere, which doens't make debugging easy). The
> closest I've got so far, is to create a class object that mimics all the
> recordset functions and returns error values instead of stopping the
> program.

> Does anyone else have any better solutions.

> Steven Palmer



Fri, 02 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Update recordset error

2. How to trap empty recordset error 3146?

3. ADODB.Recordset error '800a0cb3'

4. Unexplicable Recordset Error

5. Recordset Error

6. Recordset error

7. Recordset error Access2000 ADODB

8. VBS ADODB.Recordset Error: 800A0CC1

9. ADODB Recordset Error

10. DtPicker and recordset error

11. Win98/VB5 recordset error

12. MSFlexgrid.datasource = recordset - Error - Please help.

 

 
Powered by phpBB® Forum Software