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

2 Responses to Package Access Runtime Application with ODBC

  1. Leon says:

    Thanks so much for this! It was exactly what I was looking for as I was bundling up an Access application for distribution.

    I have a question: I can see the ODBC connection is the registry, but I can’t see it in the ODBC administrator. Any clue as to why this is the case?

    Again, thanks very much for posting this information!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: