Re: ADO Connection Timeout
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Wed, 3 Jan 2007 11:32:20 -0500
Robert McCarter wrote:
When I am running my program, and I unplug theThis is strange. When I use the following vbscript code to try to open a
cable it still takes 30 seconds to get an error. I have tried
ConnectionTimeout on the connection and CommandTimeout on the Command
and had no luck.
connection to a nonexistent database file I get an error back almost
instantaneously, although I am presuming some sort of caching is going
on, because my initial attempts took about a second.
dim cn, t
t=now
set cn=createobject("adodb.connection")
cn.commandtimeout=2
on error resume next
cn.open "provider=microsoft.jet.oledb.4.0;" & _
"data source=\\nonexistentserver\someshare\nonexistent.mdb"
if err<> 0 then
msgbox err.description,,(now-t)
else
msgbox "success",(now-t)
end if
cn.close
I was testing the relevance of the connectiontimeout setting, which I
believe only applies to the time period following the location of the
database file/server. Once the file/server is found, that is when the
actual connection attempt is made. The actual connection attempt is
limited by the connectiontimeout property. The timeout for locating a
network resource is controlled by either the network software or the
OS - I'm not sure which.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- Follow-Ups:
- Re: ADO Connection Timeout
- From: Robert McCarter
- Re: ADO Connection Timeout
- Prev by Date: Re: ADO Connection Timeout
- Next by Date: Re: ADO Connection Timeout
- Previous by thread: Re: ADO Connection Timeout
- Next by thread: Re: ADO Connection Timeout
- Index(es):
Relevant Pages
|
|