Solved

Loss of network/database connection

Posted on 2003-11-11
3
229 Views
Last Modified: 2010-05-03
I have an application that connects to a SQL database across the network.  I have error trapping code in place (on error...) but I can't seem to trap the error then network connectivity is lost to the SQL server or there is another problem that prevents connecting to the database.  My application opens a connection at startup and leaves the connection open since it's reading/writing data every 2-3 seconds.  Is there any way to trap those errors?  If so, I could call a routine that tries to reestablish a connection every 'x' seconds instead of failing with an error message.  Thanks for any help.
0
Comment
Question by:rkbcpi
3 Comments
 
LVL 3

Accepted Solution

by:
ketapillar earned 250 total points
ID: 9726210
try adding this before you execute the sql...

If ConnSQL.State <> adStateOpen Then ConnSQL.Open

where ConnSQL is the name of your connection
0
 

Author Comment

by:rkbcpi
ID: 9732649
I thought I had that in place, but maybe I missed some spots.  I'll double check and let you know.  Thanks.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now