Re: ADO ODBC timeout via VBA
- From: "Daniel Crichton" <msnews@xxxxxxxxxxxxxxxx>
- Date: Tue, 13 Jun 2006 17:18:03 +0100
Jerry wrote on Tue, 13 Jun 2006 08:03:02 -0700:
I have a VBA query that I create and insert into a sSQL variable.
I then DIM a new ADODB.recordset and open it using:
rs.Open sSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
The sSQL refers to a table that is linked via ODBC.
It is giving me a timeout.
I have read about Connections and the like, but since the connection is
there already, I was wondering how I can lengthen the timeout to something
like 10 minutes (!) using VBA code.
Anyone have any suggestions?
Use the CommandTimeout property of the Connection object, this might work
(if CurrentProject.Connection is an object reference to an ADO connection
object).
CurrentProject.Connection.CommandTimeout = 600 '600 seconds
put this line just before the rs.Open line.
Dan
.
- Prev by Date: Re: What dataadapter should I use with an Access Database?
- Next by Date: Re: How to use ADO Seek Method With Multiple Columns
- Previous by thread: What dataadapter should I use with an Access Database?
- Next by thread: Re: How to use ADO Seek Method With Multiple Columns
- Index(es):
Relevant Pages
|
|