Trapping ADO Connection Errors
From: DavidM (spam_at_spam.net)
Date: 12/28/04
- Next message: Paul Clement: "Re: where is the Key in TreeView.NET?"
- Previous message: Greg Schretter: "Re: Macro substitution?"
- Next in thread: Veign: "Re: Trapping ADO Connection Errors"
- Reply: Veign: "Re: Trapping ADO Connection Errors"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 28 Dec 2004 16:11:47 -0600
I have a VB6 application that uses ADO to communicate with SQL Server 2000.
The application works fine, however I seem to have issues with trapping
connection errors with ADO.
I have a basic Error Handler in all my functions and display both VB and ADO
errors when they occur -- however, the problem I seem to be having is this:
1) I create ADO Connection object and successfully log into SQL Server. No
problems.
2) I can create Recordset objects using Connection objects to perform
various operations on my database.
3) However, if I disconnect my network cable or disconnect my VPN connection
to work while my application is idle doing nothing, and then attempt to
perform a database operation... I normally get a slew of errors... some of
which seem to get hung in a loop.
Some of the errors are from when I try to open a recordset connection within
a With block or whatever other commands try and use an ADO command after the
connection is lost.
What is the best way to handle this?
Also, I currently display on the status bar "Connected" after a user
successfully logins in an my ADO Connection object is created. I would like
to dynamically change this to "Disconnected" when I can no longer
communicate with database.
I assume, if this happens, I will have to have a way for the user to attempt
to log back into the application and re-create the connection object atain.
Anyone know the best way to handle this?
- Next message: Paul Clement: "Re: where is the Key in TreeView.NET?"
- Previous message: Greg Schretter: "Re: Macro substitution?"
- Next in thread: Veign: "Re: Trapping ADO Connection Errors"
- Reply: Veign: "Re: Trapping ADO Connection Errors"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|