Results 1 to 5 of 5

Thread: Time-out setting

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    7
    Anyone know how to specify the time-out parameter in connection string?

    I am using vb+sql, but I guess this setting should be very general and can be used both in ODBC and OLE.DB?

    Thanks,
    lupus

  2. #2
    New Member
    Join Date
    May 2000
    Posts
    3

    Try This

    You don't put the time-out info in the connection string, you specify the time-out as follows:

    Dim cn as New ADODB.Connection
    cn.ConnectionTimeout = 30 'Default is 15 sec.
    cn.ConnectionString = "... 'Put connection string here

    Hope this helps!
    -Glen

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    7
    Thanks, it certainly helps.

    However, it seems it has no influence on the connection.
    Should I actually use "CommandTimeout" setting?

    Because my problem is when I run a huge SQL statement after
    connected, the server will send back a error message saying
    "timeout"..., however "CommandTimeout" has no influence either...

    Any idea about it?
    lupus

  4. #4
    Addicted Member JasonGS's Avatar
    Join Date
    May 2000
    Location
    California
    Posts
    155

    Cool

    ConnectionTimeout is the timeout for the connection
    CommandTimeout is the timeout for the SQL commands

  5. #5
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Do take note there is no ODBC equivalent. You must use ADO if you want/need to set timeout values. It's the main reason I'm converting my ODBC code...

Posting Permissions

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



Click Here to Expand Forum to Full Width