--> (Word) | --> (PDF) | --> (Epub) | --> (Text) |
--> (XML) | --> (OpenOffice) | --> (XPS) | --> (MHT) |
SCENARIO
I am programming with visual basic and I have a large query wich takes too long for execution. After 30 seconds I get a timeout error. Is there any way to raise the timeout to 90 seconds or something.
SOLUTION
On Error Resume Next
Set cn = New ADODB.Connection
cn.Provider = "SQLOLEDB"
cn.Properties("Initial Catalog").Value = "DatabaseName"
cn.Properties("Data Source").Value = "ServerName"
cn.Properties("Connect Timeout").Value = 90
cn.Properties("General Timeout").Value = 90
cn.Properties("Persist Security Info").Value = False
cn.ConnectionTimeout = 90
cn.CommandTimeout = 90
cn.Open
SOURCE | LINK (dbforums.com) | LANGUAGE | ENGLISH |