Click to See Complete Forum and Search --> : ODBC timeout
smitty
Feb 15th, 2000, 09:43 AM
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.
JHausmann
Feb 16th, 2000, 12:42 AM
Set the QueryTimeout property after you open the database object(s).
Clunietp
Feb 17th, 2000, 12:39 AM
Are you using an ADO COMMAND object to do your queries? What are you using?
smitty
Feb 17th, 2000, 01:11 AM
I am using ADO.
Tonatiuh
Feb 17th, 2000, 11:48 AM
Could you write a sample syntax?
Thanks
VorTechS
Feb 20th, 2000, 06:47 PM
If you are using MS Access d/b: -
myDatabase.querytimeout = 10
or a connection object: -
myConnection.querytimeout = 10
JHausmann
Feb 21st, 2000, 12:14 PM
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.
JHausmann
Feb 22nd, 2000, 02:58 AM
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).
Tonatiuh
Feb 22nd, 2000, 11:24 AM
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!
JHausmann
Feb 23rd, 2000, 01:10 AM
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.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.