Page 1 of 1 1
Topic Options
#126019 - 2004-09-01 06:03 PM ODBC - SQL Force TCP/IP setting instead of NamePipe?
Learic Offline
Fresh Scripter

Registered: 2004-02-16
Posts: 12
I've looked over the internet and can't find a solution to my problem. I have a script that goes in the registry and creates the proper entries to connect to a SQL database using SQL Authentication. The issue I've run into is that some workstations in our environment are defaulted as Named Pipes instead of TCP/IP for the network library configuration for a connection.

This causes two scenarios..

configured TCP/IP before script - creates the new ODBC connection and runs perfectly with the SQL server.

configured Named pipes before script - creates the new ODBC connection fails.

I've gone through the registry of both machines and haven't found any settings that are altered when the Named Pipes is changed to TCP/IP for default ODBC connections that are created. Does anyone know where to change this value so I can add it to my script to force workstations pre-configured as Named Pipes to use TCP/IP for my new DSN?


Top
#126020 - 2004-09-01 09:01 PM Re: ODBC - SQL Force TCP/IP setting instead of NamePipe?
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Using the handy dandy RegShot utility once again...I can see what change is being made when the setting is changed.

$null = WriteValue("HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo","<sql svr name>","DBMSSOCN,<sql svr name>",REG_SZ)

should change the setting to TCP/IP for connections going to whatever server you specicy in the key. For example if the ODBC was pointing to a SQL server name TESTSQL1 then you would do ...

$null = WriteValue("HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo","TESTSQL1","DBMSSOCN,TESTSQL1",REG_SZ)

Give that a try

Top
#126021 - 2004-09-01 10:09 PM Re: ODBC - SQL Force TCP/IP setting instead of NamePipe?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Is this something that I need to adde to the ODBCSQL() UDF?

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.102 seconds in which 0.075 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org