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.
Printable View
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.
Set the QueryTimeout property after you open the database object(s).
Are you using an ADO COMMAND object to do your queries? What are you using?
I am using ADO.
Could you write a sample syntax?
Thanks
If you are using MS Access d/b: -
myDatabase.querytimeout = 10
or a connection object: -
myConnection.querytimeout = 10
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.
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).
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.Quote:
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!