Making ADODB More Bulletproof and Connection Timeout

From: Chuck Cobb (chuckcobb_at_aol.com)
Date: 04/29/04


Date: Thu, 29 Apr 2004 17:53:10 -0400

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



Relevant Pages

  • RE: Problems with Permissions
    ... And SBS server is only take ... the role of an internal server. ... they are all configured to connected to internal network. ... g. Run the Configure Email and Internet Connection Wizard on SBS server. ...
    (microsoft.public.windows.server.sbs)
  • Re: SQL connection timeout -- is it pretty useless or what?
    ... What is sounds like your suggesting, it that the OS DDK for network drivers ... timeout interval is still a useless setting in all but the most extreme ... Connection timeout was more useful in the ... wire, it's programmed to wait for quite some time before complaining. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Outgoing POP3 email missing/lost/not received
    ... Funny thing is that I have had this ISP for 8 years and it has always been ... It looks like when you last ran CEICW, you set the ISP's mail server to: ... Internet Connection Wizard. ... After the wizard completes, the following network connection ...
    (microsoft.public.windows.server.sbs)
  • Re: server disconnection - very often
    ... Often get the redirected folders working offline prompt on some client ... VMware virtual network interface cause network issue. ... On the Connection Type page, click Broadband, and then click Next. ... |> re-initialize the offline files cache and database on client computers: ...
    (microsoft.public.windows.server.sbs)
  • Re: OT By a mile in parts comments on Viet Nam
    ... check bank accouts etc etc whilst away but is safe to do so over wireless and using the hotel network.. ... you should regard your connection as insecure and use some ... form of encryption to protect your passwords and privacy. ... My recommendation would be to set up a VPN endpoint in the UK that you ...
    (uk.comp.sys.mac)

Loading