Package Access Runtime Application with ODBC

I build a little application in access 2007 which connected to a SQL Server backend via a SQL authenticated Login.

I packaged the solution up as an installer, but didn’t want to manually go round pushing out ODBC connection separate to the install process. I wanted to be able to install the ODBC as part of the main installer, and then be able to remove the ODBC connection when the app was uninstalled.

The error in question:

image

The Access package solution wizard is useful for inserting registry keys into a machine as part of an install which would resolve the above error.

To enter an ODBC connection in the registry, i added the following keys (Enterprise Director is the name of my ODBC connection)

Root: Current User
Key: Software\ODBC\ODBC.INI\Enterprise Director
Name: Driver
Value: C:\Windows\system32\SQLSRV32.dll

Root: Current User
Key: Software\ODBC\ODBC.INI\Enterprise Director
Name: Server
Value: ServerName

Root: Current User
Key: Software\ODBC\ODBC.INI\Enterprise Director
Name: Database
Value: DatabaseName

LastUser is the SQL authenticated login to access the database
Root: Current User
Key: Software\ODBC\ODBC.INI\Enterprise Director
Name: LastUser
Value: CMEntDir

image

The overall effect of having these keys is that the ODBC is installed automatically without any additional action.

When opening the App, i know get the following prompt:

image

and the registry key is installed:

image

image

Advertisements