Re: ADO Connection Timeout



Thank you all for your comments. Daniel, with regards to SQL server express,
can you set up stored procedures on the hosting machine and use server side
cursors on your client? I realize that express is NOT sql server, but I was
wondering if that would increase my performance?

Once again, thank you all for your input. It really is valuable to me and
this is how I have learned to program.

--
Thank you,

Robert


"Bob Barrows [MVP]" wrote:

Robert McCarter wrote:
When I am running my program, and I unplug the
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.

This is strange. When I use the following vbscript code to try to open a
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.



.



Relevant Pages

  • RE: Accessing SQL Server Accross Domain
    ... Thank you for using MSDN Newsgroup! ... To access the SQL Server across domain is possible. ... make sure the connection between this two computers is OK. ... Port 1433 is the default port number for SQL Server. ...
    (microsoft.public.sqlserver.security)
  • Re: Error "SQL Server does not allow remote connections"
    ... The application could not connect to the sql server db. ... network is blocking the connection. ... SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 ... integratedSecurity, SqlConnection owningObject) +737554 ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: WSS 3.0 Sites DOWN ( again by Microsoft update??)
    ... Please only post one particular question to ONE newsgroup to avoid ... database 'WSS_AdminContent' is full. ... Wanna to manage the DB thru Microsoft SQL server mamagement stuio. ... An error has occurred while establishing a connection to the server. ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Connection from remote computer to network SQL Server
    ... There is no firewall on the W2K machine acting as the SQL server. ... I tried making the SQL machine a "trusted" on the router. ... connection works. ... To find the IP address of your computer inside the network, ...
    (microsoft.public.access.adp.sqlserver)
  • ADO.net Orcas Samples Install Problem
    ... An error has occurred while establishing a connection to the server. ... When connecting to SQL Server 2005, this failure may be caused by the ... SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, ... or am I better off with a full SQL Server install. ...
    (microsoft.public.dotnet.framework.adonet)