dbnetlib connectionwrite general network error

dodyryda

Registered User.
Local time
Today, 00:40
Joined
Apr 6, 2009
Messages
61
hi all..

I was hoping that someone may be able to point me in the right direction...

I have created an adp/sql database & it works a treat. What I get occasionally are the dbnetlib connectionwrite general network error's when for whatever reason the network falls/fails...

What I would like to do is to catch this error and attempt a reconnect at say 2 min intervals until a successful connection is established..

is what I'm trying to do possible? & if so would anyone know any examples I can follow as my vba is somewhat sketchy!!..

Many Thanks Nathan
 
looking at this http://bytes.com/topic/access/answers/206947-setting-currentproject-connection-vba

the following code may help... but where do I need to place the sub? Would I need this on both the Ondisconnect event and say the onTimer event so that it retrys connections when it first disconnects and then say on a 2 mins timer..

Will that do the trick?

Public Sub LetConnectionString()
With CurrentProject
If Not .IsConnected Then
.OpenConnection ("PROVIDER=SQLOLEDB.1;" _
& "INTEGRATED SECURITY=SSPI;" _
& "PERSIST SECURITY INFO=FALSE;" _
& "INITIAL CATALOG=FFDBAESO;" _
& "DATA SOURCE=ITSERVER9;" _
& "Use Procedure for Prepare=1;" _
& "Auto Translate=True")
End If
End With
End Sub
 

Users who are viewing this thread

Back
Top Bottom