Results 1 to 10 of 10

Thread: ODBC timeout

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    TN
    Posts
    11

    Post

    Is there a way to shorten the timeout, when my prog. tries to exe. a query and it can't communicate with the server. Right now it takes approx. 30 sec.'s. I don't want my prog. to wait that long to alert.

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Set the QueryTimeout property after you open the database object(s).

  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Are you using an ADO COMMAND object to do your queries? What are you using?

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    TN
    Posts
    11

    Post

    I am using ADO.

  5. #5
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274

    Post

    Could you write a sample syntax?

    Thanks

  6. #6
    Lively Member
    Join Date
    Jan 1999
    Location
    Gloucester, UK
    Posts
    78

    Post

    If you are using MS Access d/b: -

    myDatabase.querytimeout = 10

    or a connection object: -

    myConnection.querytimeout = 10

  7. #7
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Bear in mind, there's a certain amount of time allocated to the network for making the connection _and_ setting the timeout will not alleviate that.

  8. #8
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Setting the value, for you, higher shouldn't hurt you. Your LAN users will connect as normal and your WAN users will get a chance to make the connection.

    ADO, if you're using it, has two properties you'll want to set (connectiontimeout [defaults to 15 seconds] and commandtimeout [defaults to 30 seconds]). I've got programs using ODBC to connect to SQL Server6.5 that fail using ODBC that no longer do using ADO
    simply because I'm able to set, in ADO, the command timeout property. I'm now in the process of converting my ODBC code to ADO (which is a lot easier than one would think).

  9. #9
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274

    Post

    My problem is this:

    In my LAN all PC's (with my app) access to data well.

    We have another PC's in another city (a WAN) that have problems. The recordsets retunrs empty. The speed connection is very slow in this PC's.

    Do you really think the querytimeout fix the problem?

    Thanks!

  10. #10
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post Re: ODBC timeout


    My problem is this:

    In my LAN all PC's (with my app) access to data well.

    We have another PC's in another city (a WAN) that have problems. The recordsets retunrs empty. The speed connection is very slow in this PC's.

    Do you really think the querytimeout fix the problem?

    Thanks!
    Oddly enough, my answer comes before your question. I must've been prescient.

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