July 10, 2002 at 12:58 pm
with both ADO and SQLDMO I find that setting the timeout property while connecting doesn't do too much. Regardless of what it set timeout to in sqldmo it will wait up to 75 seconds to tell me a server does not exists. i have tried logintimeout=1
is there anyway I can manipulate this to make it shorter (so user's don't have to wait so long to see this result) or longer so it can wait for a remote server to connect like in the case of web based sql server?
what am i doing wrong with logintimeout property?
Brian Lockwood
President
LockwoodTech Software
Brian Lockwood
President
ApexSQL - SQL Developer Essentials
July 10, 2002 at 3:42 pm
Never needed it much so far! I ran this as a test:
Dim oserver As SQLDMO.SQLServer
Dim sngStart As Single
On Error GoTo Handler
Set oserver = New SQLDMO.SQLServer
With oserver
.LoginSecure = True
.LoginTimeout = 2
sngStart = Timer
.Connect "eg\two"
Debug.Print "Elapsed: "; Timer - sngStart
End With
oserver.DisConnect
Set oserver = Nothing
Exit Sub
Handler:
Resume Next
Ran it three times with a 5 sec delay, got these times:
Elapsed: 8.554688
Elapsed: 8.484375
Elapsed: 8.542969
Changing to 2 second delay:
Elapsed: 4.183594
Elapsed: 4.226563
Elapsed: 4.175781
All of these with a local instance stopped. Looks like 2-2.5 seconds of overhead between the object itself and maybe the error handler. Nothing close to 75 seconds. Possibly because it's local, but you wouldnt think it would matter.
Andy
July 10, 2002 at 8:33 pm
thx - i tried it and here's what i get ...
Elapsed: 85.1875
Elapsed: 85.1875
Elapsed: 89.57813
running your code. i'm hitting a sql2k server on local machine.
just to be clear this is a bogus connection string you are using right? the goal is to attempt to connect then quit if it doesn't connect in x seconds.
Brian Lockwood
President
LockwoodTech Software
Brian Lockwood
President
ApexSQL - SQL Developer Essentials
July 11, 2002 at 6:20 am
Its a server that has the service stopped. Could some people try the test code I posted earlier?
Andy
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply