View Full Version : Create Access or SQL system DSN

12-24-2001, 11:43 AM
We have software users with a Microsoft Access Database and other users with a SQL Server database.
When installing the software, how can we give the users the option of selecting which database they have and then create that DSN accordingly.

Thanks for any help,


12-25-2001, 12:37 PM
Unfortunately we don't have anything in InstallScript to automatically detect what databases the user has on their system.

However, you could use a custom DLL function to get this information.

Once you have this information you could simply use the ODBC object from script to dynamically create the DSN you want.

To get a reference to the ODBC object:

function OnBegin()
set obj = GetObject("New ODBC 3.51 1" ); // Parameter is EXACT name of object as it appears in your components view


An example and further information about installing a DSN via the script is available in the help document for the object (should be visible if you select the object in the Object Gallery).