Re: ADO ODBC timeout via VBA



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


.



Relevant Pages

  • MSDE timeout with wireless network enabled
    ... connected to our network I can connect through my ODBC application ... when I have wireless networking enabled the first time I try to ... that initial timeout without a problem. ... connection. ...
    (microsoft.public.sqlserver.msde)
  • Re: OE6 does not connect with pop3 server
    ... Can we infer from this that you got a timeout on the EarthLink account ... My point about making an approximate timestamp is just to look at the ... E.g. as near as possible before the connection ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Timout control with RPC/HTTP
    ... specifies the minimum connection timeout used by the ... client and RPC Proxy, in seconds. ... Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.exchange.admin)
  • Re: Timout control with RPC/HTTP
    ... please also check the RPC web site connection timeout settings ... Maybe the idle timeout settings depend on here. ...
    (microsoft.public.exchange.admin)
  • Re: web serivce: client side timeout?
    ... client side but only from the server side. ... System.Net.Sockets.SocketException: A connection attempt failed ... asyncResult, Int32 timeout, Exception& exception) ... John Saunders | MVP - Windows Server System - Connected System ...
    (microsoft.public.dotnet.framework.webservices)