Friday, December 14, 2007

How to cancel the connection if the ADO Connection had no response?

How to cancel the connection if the ADO Connection had no response?

This happened when the ADO Connection is waiting for the connection to success.

So, we can setup the "ConnectionTimeout"properties to make a range, which is the time for Connection waiting:

<%

Set conn = Server.CreateObject("Adodb.Connection")

conn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db1.mdb")

conn.ConnectionTimeout = 30 '30 Seconds.

%>

No comments: