Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC Connection Timeout

Status
Not open for further replies.

agoeddeke

Programmer
Jul 23, 2002
201
US
Hello,

I am searching for a connection string attribute that will shorten the default timeout when connecting to SQL Server. I am using Visual Foxpro as my client and I'm trying to connect to SQL over a DSN-less connection. The default timeout seems to be 15 seconds and I'd like to shorten it to around 5.

Thanks,
Andy
 

Setthe connectiontimeout property of the connection to 5 seconds.
e.g objConnection.ConnectionTimeout=5
 
adroit,

That works fine when connecting using ADO, but I am using a DSN-less ODBC connection.

Andy
 
I use Visual FoxPro.
Try the SQLSETPROP( ) function.
I'm not connected to SQL Server, so you'll have to test this.

Andy Rice
San Diego, CA
 

I know nothing about FoxPro but theres a property dbengine.LoginTimeout, and to shorten each connection timeout once you have opened the database set MyDatabase.QueryTimeout

Maybe these comments will help.

 
Thanks Guys,

SQLSETPROP has both a ConnectionTimeout and QueryTimeout setting. I'll try playing with both.

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top