+ Reply to Thread
Results 1 to 2 of 2

Setting an ADODB connection timeout when querying SQL Database

  1. #1
    Forum Contributor
    Join Date
    07-07-2005
    Location
    England
    MS-Off Ver
    Office 2019 Enterprise
    Posts
    473

    Setting an ADODB connection timeout when querying SQL Database

    Hi, I have a VBA-driven report that is maxing out at 30 seconds (Error Number -2147217871 Query timeout expired) and I was hoping someone could help me increase that timeout time to 60 seconds. I have added this line which from Google searches, I thought would do the job but still maxes out at 30 seconds..

    'cnnConnect.ConnectionTimeout = 60'

    My Code.. Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,008

    Re: Setting an ADODB connection timeout when querying SQL Database

    Try the CommandTimeout property instead. The connectiontimeout is for the initial connection attempt only.
    Everyone who confuses correlation and causation ends up dead.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Querying another closed Workbook using SQL using ADODB connection
    By yoursamrit2000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2019, 08:59 PM
  2. Replies: 0
    Last Post: 07-13-2017, 04:58 AM
  3. Trailing Characters/Space when querying via ADODB.recordset getrows
    By Jay-T in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-27-2016, 08:53 AM
  4. ADODB connection - Changing connection path via fileDialog
    By cajand in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2015, 08:06 AM
  5. [CLOSED - NOT SOLVED] Excel External Data Connection - Timeout?
    By Rudurk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-17-2014, 08:40 AM
  6. Cannot Use ADODB.Connection to connect to an access database
    By Cardinalbags in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2012, 07:09 PM
  7. [SOLVED] ADODB Timeout
    By MChrist in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2005, 01:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1