MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_NextPart_01CD74AF.190E5180" Questo documento č una pagina Web in file unico, nota anche come archivio Web. La visualizzazione di questo messaggio indica che il browser o l'editor in uso non supporta gli archivi Web. Scaricare un browser che supporti gli archivi Web, come Windows® Internet Explorer®. ------=_NextPart_01CD74AF.190E5180 Content-Location: file:///C:/D9044B14/Visual-Basic-Query-Timeout.htm Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="windows-1252"
SCENARIO=
I am programming with visual basic and I hav=
e a
large query wich takes too long for execution. After 30 seconds I get a tim=
eout
error. Is there any way to raise the timeout to 90 seconds or something.
SOLUTION=
On Error
Resume Next
Set cn =
=3D New
ADODB.Connection
cn.Provi=
der
=3D "SQLOLEDB"
cn.Prope=
rties("Initial
Catalog").Value =3D "DatabaseName"
cn.Prope=
rties("Data
Source").Value =3D "ServerName"
cn.Prope=
rties("Connect
Timeout").Value =3D 90
cn.Prope=
rties("General
Timeout").Value =3D 90
cn.Prope=
rties("Persist
Security Info").Value =3D False
cn.Conne=
ctionTimeout
=3D 90
cn.Comma=
ndTimeout
=3D 90
cn.Open<= o:p>
Visual
Basic - Query Timeout |
04/04/2012 |