Re: First connection from Vista client to SQL Server 2005 times out



Thanks, Bill. I think we have the timeout set to 30 seconds.The same
app connects instantly to the same database/server if run on a Win2K
or WinXP machine on the same network. It connects instantly the second
time you try it on a Vista machine.

In playing around some more, I have found that SQL Server Management
Studio has similar problems connecting from the Vista machine as well,
that is, it times out the first time, you click connect a second time
and it connects instantly. Trying to setup an ODBC System DSN does the
same thing. Times out the first time, then when you try again it
creates the DSN and it tests fine.

Very strange....

Saw your earlier advice to someone else about the Native SQL driver.
We're looking in to that. Quick question, can we distribute it for
Win2K and WinXP users? How would they get it installed? How does it
normally end up on a client PC?

On Jul 14, 1:09 pm, "William \(Bill\) Vaughn"
<billvaRemoveT...@xxxxxxxxx> wrote:
Have you tried to increase the Connection Timeout=nn key in the
ConnectionString? It's normal for SQL Server to take longer to connect the
first time but it is unusual for it to timeout as the default timeout is
fairly long (60 seconds IIRC).
In any case I suggest you use the SQL Native Client OLE DB provider written
specifically for SQL Server 2005. It eliminates the dependency on the MDAC
stack.http://msdn2.microsoft.com/en-us/library/ms131035.aspx

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speakerwww.betav.com/blog/billvawww.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visitwww.hitchhikerguides.netto get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
---------------------------------------------------------------------------­--------------------------------------------<rn...@xxxxxxxxxx> wrote in message

news:1184357726.157210.293000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



This is very odd.

I have a VB6 application. I have fixed it up to play nice with Vista,
and embedded a manifest (contents at the end of this post) into the
exe.

When I try to connect to the SQl Server 2005 server from a Vista
client, I get a timeout on the first try. My app asks to verify the db
settings (server name, db name, etc.), and I do that, retry and it
connects fine. It does this every time. It only fails to connect on
the first try, it always connects on the second try.

The app has an optional second database it can connect to, and it does
the same thing. Times out on the first connection attempt, click the
retry connection button and it connects just fine.

But here's the weird part. If I recompile the app, and do not embed a
manifest, it works fine with no other changes. So the manifest is
cause this for some reason.

Here's what the connect string looks like:

Provider=SQLOLEDB;Server=10.0.0.167;UID=;PWD=;DATABASE=thedb;Trusted_connec­tion=yes;Persist
Security Info=True

It doesn't matter if I use a trusted connection and "NT
authentication" or supply a user name/password for SQL Server
authentication. It doesn't matter if I put the server name or the IP
address. It always times out on the first connection and works on the
second connection, but only if there is a manifest embedded (otherwise
it connects fine on the first try).

(And yes, I'm aware the Persist Security Info is a no no -- the app
was copying the connect string around in a couple of places, and I'm
in the process of cleaning that up so this is temporary).

Here's what the manifest looks like:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asinvoker"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

In this case, I am logged in from a domain user ID with domain
administrator permissions. Haven't even started trying to test it as a
mortal user yet.

Any suggestions?- Hide quoted text -

- Show quoted text -


.