PDA

View Full Version : Create Access or SQL system DSN



geerae
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,

Geerae

JacobLevin
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()
OBJECT obj;
begin
set obj = GetObject("New ODBC 3.51 1" ); // Parameter is EXACT name of object as it appears in your components view

end;

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).