Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC with SQL2K using WSH

Status
Not open for further replies.

rnpIII

Technical User
May 2, 2001
61
US
Hello All,

I realize this question is not directly VBScript, I am hoping you will at least be able to shed some light on it though being programmers. I am not real good with WSH so I am sure it is something simple, just can't figure out what.

I have seen your FAQ on ODBC connections, but I don't know how to apply that with WSH (Windows Scripting Host) or how to have it run on other clients.

I am attempting to set up a system DSN for a SQL2K database using WSH or any other programming language native to Windows 2K and XP.

I have been through so many different possibilities these last few days, I am in a haze.

Scenario:
- SQL 2K ODBC drivers on all clients
- Mix of 2K and XP clients
- ODBC connection with SQL server authentication...
Need to use something programmatic so I do not have to touch about 100 or so clients.

In most cases the ODBC connection can be set up using a program called "TrackIT Deploy". The problem is it does not set up the password, (SQL server authent...) so I still have to touch each client.
This calls for a late night.

SO! Would anyone be able to assist with some suggestions as to how to go about this?

I have some code written but it does nothing, as far as I can tell. See below:

Function LinkToLiaison()

strDVR = "{SQL Server}"
strSVR = "LIAISON\SQL2K"
strDSN = "LIAISON_SQL2K"
strUID = "userID"
strPWD = "userPWD"
strdB = "master"

strConnect = "driver="& strDVR & _
";SERVER=" & strSVR & _
";DSN=" & strDSN & _
";Database=" & strdB & _
""
Conn.Open strConnect, strUID, strPWD
End Function

Any suggestions, assistance will be greatly appreciated.

rnpIII
 
If your intent is to create a system DSN, simply use a .reg file.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Hello PHV,

Thank you for your response.
As for getting a great answer from tek-tips, I usually do after a little bit of digging.
I can appreciate the knowledge base within this organization and really do try not to bother asking a question until I feel I have exhausted all other options.

I had thought about using a reg file, I assume it will be concerning the entries for ODBC.ini?

Would you know of any other entries that would be pertinent to making this work?

rnpIII
 
Example of .reg file for 2 new DSN:
Code:
REGEDIT4

[HKEY_LOCAL_MACHINE\Software\ODBC\odbc.ini\ODBC Data Sources]
"phvdtb02"="Tun32 Driver"
"phvdtb03"="Tun32 Driver"

[HKEY_LOCAL_MACHINE\Software\ODBC\odbc.ini\phvdtb02]
"Driver"="C:\\WINDOWS\\SYSTEM\\TUNODB32.DLL"
"Description"="phvdtb02 : SOC02"
"ServerName"="unixphv"
"ServiceName"="TUNODBC200.ifx"
"Database"="phvdtb02"
"UID"="phvodbc"
"PWD"="phvodbc"
"Version"="2"
"TranslationName"="[0]"
"TranslationDLL"=""
"TranslationOption"=""

[HKEY_LOCAL_MACHINE\Software\ODBC\odbc.ini\phvdtb03]
"Driver"="C:\\WINDOWS\\SYSTEM\\TUNODB32.DLL"
"Description"="phvdtb03 : SOC03"
"ServerName"="unixphv"
"ServiceName"="TUNODBC200.ifx"
"Database"="phvdtb03"
"UID"="phvodbc"
"PWD"="phvodbc"
"Version"="2"
"TranslationName"="[0]"
"TranslationDLL"=""
"TranslationOption"=""

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
PHV,

Many thanks. I believe we have it now.
I am using this to install Business Objects with TrackIT Deploy and it was not communicating with the server until I touched the client with the SQL password.

After a little testing, this looks like, on the face of it, it will do the trick.

Once again, thank you for your prompt and concise response.

rnpIII
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top