C
Chuck Cobb
I'm trying to make my code more "bulletproof"...I have a user who is using a
wireless LAN network connection that is very unreliable and it has caused
some problems. For example, sometimes when they have a very bad network
connection the ADODB connection can hang the application. I want to make it
so that it is more graceful about handling error situations like this. (My
application uses an OLEDB connection to an Access database - or it can use
SQL Server)
I'm looking at various potential failure points to see what can be done to
handle errors due to network failures. One example is attempting to open a
database connection over an unreliable network. I would think that it would
timeout if the network wasn't there and I tested that by unplugging the
network cable to the client system before it attempted to open the
connection and it just hangs the application. The code to open the
connection is shown below. With the network connection unplugged, the
application will hang on the dbConn.Open instruction and doesn't timeout:
Dim dbConn As New OleDbConnection(strConnString)
dbConn.Open()
Any idea why this won't timeout and declare an error? Does anyone have any
other suggestions of what to do to make ADODB more "bulletproof" over
unreliable network connections? For example, I initialize the connection
once when the application is initialized and leave it open. Perhaps a
better approach would be to close it and re-open it and run some kind of
test that it can actually connect and transfer data prior to doing a live
data transfer. Any ideas would be appreciated.
Thanks,
Chuck
wireless LAN network connection that is very unreliable and it has caused
some problems. For example, sometimes when they have a very bad network
connection the ADODB connection can hang the application. I want to make it
so that it is more graceful about handling error situations like this. (My
application uses an OLEDB connection to an Access database - or it can use
SQL Server)
I'm looking at various potential failure points to see what can be done to
handle errors due to network failures. One example is attempting to open a
database connection over an unreliable network. I would think that it would
timeout if the network wasn't there and I tested that by unplugging the
network cable to the client system before it attempted to open the
connection and it just hangs the application. The code to open the
connection is shown below. With the network connection unplugged, the
application will hang on the dbConn.Open instruction and doesn't timeout:
Dim dbConn As New OleDbConnection(strConnString)
dbConn.Open()
Any idea why this won't timeout and declare an error? Does anyone have any
other suggestions of what to do to make ADODB more "bulletproof" over
unreliable network connections? For example, I initialize the connection
once when the application is initialized and leave it open. Perhaps a
better approach would be to close it and re-open it and run some kind of
test that it can actually connect and transfer data prior to doing a live
data transfer. Any ideas would be appreciated.
Thanks,
Chuck