|
-
Sep 22nd, 2005, 11:40 AM
#1
Thread Starter
Addicted Member
Error Checking for Recordset [resolved]
I am writing a program that needs to run 24/7 for a couple weeks at a time. It writes a record with 14 fields to a single table database every 2 minutes or so. Would it be more appropriate for me to close and open the connection each time or leave the connection open all the time? I was thinking I should open and close it so that if I the network goes down I can write a csv to the harddrive until the network comes back up. Otherwise, there isn't a way to know if I've lost the connection is there?
Last edited by just_a_me; Sep 22nd, 2005 at 02:08 PM.
Reason: resolved
-
Sep 22nd, 2005, 11:57 AM
#2
Re: Error Checking for Recordset
What happens to your program if the network goes down, and then gets brought back up again? Does it have to be manually restarted? I'm guessing so.
I would keep the connection open, and the routine error trapped. If the error indicating network connection failure occurs then take appropriate action. (Write the date and time and whatever else to a text file perhaps that you can check for time to time.)
-
Sep 22nd, 2005, 12:25 PM
#3
Thread Starter
Addicted Member
Re: Error Checking for Recordset
The program will continue to run when the network is down because it is installed on a local machine. When the network comes back I will store all the info from the csv to the database. If I have the connection open all the time where can I get the network connection error? When I try to open the recordset?
-
Sep 22nd, 2005, 01:14 PM
#4
Re: Error Checking for Recordset
 Originally Posted by just_a_me
The program will continue to run when the network is down because it is installed on a local machine. When the network comes back I will store all the info from the csv to the database. If I have the connection open all the time where can I get the network connection error? When I try to open the recordset?
You said your application will be writing a record to your back end database every couple of minutes or so. Every single time it writes that record it uses that network connection. If that network connection isn't there and a database write is attempted, you will get an error (trust me on this one )
If you have it trapped, then in your error trapping routine you can redirect your write to your .CSV file.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|