Can I change the connection time out for MS Access (using OLEDbConnection) ?

F

fniles

Can I change the connection time out in VB.Net 2003 and MS Access (using
OLEDbConnection) ?
When I use Connect Timeout = 60 in the connectionstring, I get an error
"Multiple-step OLE DB operation generated errors. Check each OLE DB status
value, if available. No work was done."

Thanks.

ConnectionOLE = New OleDb.OleDbConnection
sPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sDBPath &
";Connect Timeout=60" ???
With ConnectionOLE
..ConnectionString = sPath
..Open() --> error "Multiple-step OLE DB operation generated errors. Check
each OLE DB status value, if available. No work was done."
 
D

Daniel E. Ulfe

I am not sure is this has something to do with it... but I thing it should
be: ""... ;Connect Timeout=60;" (note the ";" at the end)... well... if that
does not work... you can try the "ConnectionTimeout" property of the
connection like:

myCnn.ConnectionString = myConnectionString
myCnn.ConnectionTimeout = 60
myCnn.Open

Hope this helps...

Daniel.
 
F

fniles

Thank you.
I tried "... ;Connect Timeout=60" (without ";" at the end) and it gave the
same error.
When I do myCnn..ConnectionTimeout = 60 it says "property ConnectionTimeout
is 'Read Only'"
May be I can set ConnectionTimeout for MS Access (only for SQL Server) ?
What is the default ConnectionTimeout for MS Access using OLEDBConnection ?

Thank you.
 
D

Daniel E. Ulfe

Hi...

My bad... the ConnectionTimeout is indeed ReadOnly.... (brain fart)

The default timeout (according to the help file) is 15 seconds... that it
should be enough to get access to your DB...
May be I can set ConnectionTimeout for MS Access (only for SQL Server) ?

Are you using "link tables" in MS Access? (Using VB to connect ACCESS and
ACCESS to connect SQL?)

Sorry... I could not make "Connect Timeout" work with OLEDB-JET... :(

Daniel.
 
P

Paul Clement

¤ Thank you.
¤ I tried "... ;Connect Timeout=60" (without ";" at the end) and it gave the
¤ same error.
¤ When I do myCnn..ConnectionTimeout = 60 it says "property ConnectionTimeout
¤ is 'Read Only'"
¤ May be I can set ConnectionTimeout for MS Access (only for SQL Server) ?
¤ What is the default ConnectionTimeout for MS Access using OLEDBConnection ?

The ConnectionTimeout property must be set prior to opening the connection to the database. The
default value is 15.


Paul
~~~~
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top