With cn
.ConnectionString = "driver={SQL
Server};server=[server];uid=sa;pwd=;database=[database];"
.ConnectionTimeout = 10
.Open
End With
On some computers this works fine and the connection is opened. On others
it attempts to use Named Pipes to connect to the remote database which
fails.
Is there any parameter I can pass or environment variable I can set so that
TCP/IP is always used?
I have also come across a similar problem, which may have the same answer,
and that is as follows. When using a machine which has Enterprise Manager
installed to connect to a remote SQL Server, it tells me that the server
does not exist. If I set up an ODBC Connection to a local server and tell
it to use TCP/IP, the connection in Enterprise manager then works OK.
TIA
Pete
a little unsure of my answer with regards to your problem.
"Peter Joules" <pe...@investe.net> wrote in message
news:994162963.8041.0...@news.demon.co.uk...
We are running the latest SQL Server ODBC drivers. This seems to be an
issue as to how to tell the ODBC driver to use TCP/IP rather than named
pipes by default. It will do it OK once one has been into the ODBC applet
and set up a DSN, changing the default to TCP/IP, but not when the only
connection is one which is set up on the fly.
--
Regards
Pete
The Network Library can be passed as a parameter in the connection
string.
"driver={SQL>
Server};server=[server];uid=sa;pwd=;database=[database];Network
Library=[DLL];"
If you have the MSDN library ADO260.chm has this info in it.
[DLL] name of the network library used to communicate with the SQL
Server.
The name should not include the path or the .dll file name extension.
The default is provided by the SQL Server client configuration.
Dan
"Peter Joules" <pe...@investe.net> wrote in message
news:994162963.8041.0...@news.demon.co.uk...