Click to See Complete Forum and Search --> : Time-out setting
lupus
Jun 1st, 2000, 12:25 AM
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
Glen_Kruse
Jun 1st, 2000, 12:34 AM
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!
lupus
Jun 1st, 2000, 03:26 AM
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
JasonGS
Jun 1st, 2000, 05:54 AM
ConnectionTimeout is the timeout for the connection
CommandTimeout is the timeout for the SQL commands
JHausmann
Jun 2nd, 2000, 06:01 AM
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...
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.