OLEDB Connection - Timeout Setting / Open Type

Ian W

Active member
Joined
Feb 11, 2010
Messages
31
Programming Experience
1-3
I have a couple of programmes all accessing the same tables and i've run into an issue where every now and again two users process an update at the same time and one ends up with a lock error.

I think a timeout setting will fix this as it will *hopefully* just retry to transaction and pass through successfully.

I'm having trouble trying to work out how I set the timeout property for a OleDB connection though?

Is it possible to open the DB in different modes, record locking level rather than exclusive access?

Current connection string is

VB.NET:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
           & "C:\Application\SerialData.mdb" ;User Id=admin;Password=;"

If I cannot accomplish this using OleDB what is the better alternative to give me more options? ADO.Net?
 
Last edited:
It's not the connection timeout you care about, it's the command timeout. Both the OleDbConnection and OleDbCommand have a property for their respective timeout values.

That said, I believe that the default value is 30 seconds, so that might be of any help to you. You might have to handle the exception in your app and then retry explicitly.
 
Back
Top