Jump to content

ODBC SQL data source drivers...


marvc

Recommended Posts

I wasn't sure if I should post here or the Device drivers forum so I apologize in advance if any rules are being broken.

I'm wondering if anyone can confirm if it's possible to package and deploy the ODBC data source drivers as an exe or msi file? I have an app that calls for the SQL server data source driver to be installed on all XP client systems. I've tried repackaging the drivers in the application using the SMS installer but haven't had any luck so I'm wondering if it's possible to do this seperately.

Any responses are appreciated.

Link to comment
Share on other sites


Correct. I guess what I need is to be able to add a DSN connection to a SQL database using the SQL driver. My problem is figuring out how to package this as it seems to involve adding registry keys. THe other problem is making sure that this DSN remains available for all users.

Any responses are appreciated.

Link to comment
Share on other sites

You can create sql server dsns via registry files, example below.

[HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\DSNNAME]
"Driver"="C:\\WINDOWS\\system32\\sqlsrv32.dll"
"Description"="Description"
"Server"="sqlservername"
"Database"="databasename"
"LastUser"="sqlusername"

[HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\ODBC Data Sources]
"DSNNAME"="SQL Server"

oops edited to be HKEY_LOCAL_MACHINE to make into system dsns

Edited by m4dh0
Link to comment
Share on other sites

I may need a little more assistance as I was under the impression that the following keys needed modifying:

HKLM\Software\ODBC\ODBC.INI

HKLM\Software\ODBC\ODBC.INI\ODBC Data Sources

HKLM\Software\ODBC\ODBCINST.INI\ODBC Drivers

HKLM\Software\ODBC\ODBCINST.INI\ODBC Driver Name

Here's the DSN I need to create:

Name: TCL

Description: TCL

Server: MyTCLServer

Windows NT authentication

Use ANSI quoted identifiers: No or Unchecked

Use ANSI nulls, paddings, and warnings: No or unchecked

How do I create this as a System DSN so that it applies to all user systems regardless of who's logged in??

Thanks

Link to comment
Share on other sites

the following registry file "should" do it

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\TCL]
"Driver"="C:\\WINDOWS\\System32\\sqlsrv32.dll"
"Description"="TCL"
"Server"="MyTCLServer"
"QuotedId"="No"
"AnsiNPW"="No"
"Trusted_Connection"="Yes"

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]
"TCL"="SQL Server"

as the above is all under HKLM it automaticaly becomes a system dsn available to all users

You also dont need to add anything under HKLM\Software\ODBC\ODBCINST.INI as the needed entries are already in place.

Ps. ive not tested this :whistle:

Link to comment
Share on other sites

Thanks for the response. I think I see what you're saying:

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\TCL]

"Driver"="C:\\WINDOWS\\System32\\sqlsrv32.dll"

"Description"="TCL"

"Server"="MyTCLServer"

"QuotedId"="No"

"AnsiNPW"="No"

"Trusted_Connection"="Yes"

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]

"TCL"="SQL Server"

My next question is how to apply this? I added this in SMSI under Runtime Support\SQL Server ODBC 32 Driver as:

Data Source Name: TCL

Driver Name: SQL Server

AnsiNPW=No

Database=MyTCLDatabase

Description=TCL

Driver=sqlsrv32.dll

Language=default

OemToAnsi=No

QuotedId=No

Server=MyTCLServer

TrustedConnection=Yes

UseProcForPrepate=Yes

System DSN checked

I then repackage, compile, and run the executable but the DSN doesn't appear under ODBC. Am I missing something?

Link to comment
Share on other sites

I used Wise InstallMaster to do this a few months ago. It was a pain in the a** to get it working right, took me about 2 solid days of work. I was capturing an Oracle client installation at the same time.

The Wise product is what Microsoft SMS Installer is based on. It's works better than SMS Installed on capturing installations on XP.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...