Monday, February 20, 2012

Problem connecting to SQL Server 2005

Under certain circumstances there seems to be a problem connecting a SQL
Server 2005 (Final Release). The connection is done with a Delphi
Application using an ADOConnection (SQLOLEDB.1 provider):
- Setup a vanilla WinXP PC (Seems to also appear under Win98, WinME, and
probably every version of windows)
- Try to connect
- A connection timout appears
- Try to connect again
--> Connection works fine
My research showed that the timeout appears as long as no entry exists
in the
HKLM\Software\Microsoft\MSSQLServer\Clie
nt\SuperSocketNetLib\LastConnect
registry key (after the first unsuccessful connection attempt an entry
will be created. Therefore the next attempt will succeed)
The full connection string looks like this:
Provider=SQLOLEDB.1;
Integrated Security=SSPI;
Persist Security Info=True;
Initial Catalog=DatabaseName;
Data Source=ServerName;
Use Procedure for Prepare=0;
Auto Translate=True;
Packet Size=4096;
Use Encryption for Data=False;
Tag with column collation when possible=False
Any idea what's the problem here?
Thanks in advance
PascalHi
Check that your internal DNS is actually resolving the server, and doing it
in a timely manner.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Pascal Berger" <pascal.berger@.timeware.dontspamme.ch> wrote in message
news:eImf9okBGHA.2704@.TK2MSFTNGP15.phx.gbl...
> Under certain circumstances there seems to be a problem connecting a SQL
> Server 2005 (Final Release). The connection is done with a Delphi
> Application using an ADOConnection (SQLOLEDB.1 provider):
> - Setup a vanilla WinXP PC (Seems to also appear under Win98, WinME, and
> probably every version of windows)
> - Try to connect
> - A connection timout appears
> - Try to connect again
> --> Connection works fine
> My research showed that the timeout appears as long as no entry exists in
> the
> HKLM\Software\Microsoft\MSSQLServer\Clie
nt\SuperSocketNetLib\LastConnect
> registry key (after the first unsuccessful connection attempt an entry
> will be created. Therefore the next attempt will succeed)
> The full connection string looks like this:
> Provider=SQLOLEDB.1;
> Integrated Security=SSPI;
> Persist Security Info=True;
> Initial Catalog=DatabaseName;
> Data Source=ServerName;
> Use Procedure for Prepare=0;
> Auto Translate=True;
> Packet Size=4096;
> Use Encryption for Data=False;
> Tag with column collation when possible=False
> Any idea what's the problem here?
> Thanks in advance
> Pascal|||Mike Epprecht (SQL MVP) wrote:
> Check that your internal DNS is actually resolving the server, and doing i
t
> in a timely manner.
DNS doesn't seem to be the problem. The server responds to a Ping
Thanks
Pascal

No comments:

Post a Comment