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
Printable View
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
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!
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
ConnectionTimeout is the timeout for the connection
CommandTimeout is the timeout for the SQL commands
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...