jpriddy
Posts: 2
Joined: Fri Mar 10, 2006 4:14 pm

SQL Scripts

Hi,

I'm wondering if it is possible to run SQL Scripts ?

My requirements are... install some DLL's and register them, then run some SQL Scripts on a predefined SQL Server (therefore need to accept SQL Server name and Database name).

Is this at all possible ??

Any help welcomed :)

Cheers

Jason
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

1. In order to register a COM module:
- In the Files and Folders page, right-click on the file in question and select "Properties" from the context-menu.
- In the "Edit File" dialog, select the checkbox "Auto register file" and then select the desired registration method.

2. In order to run the SQL scripts you will use DLL or EXE Custom Actions which you must write yourself.

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
jpriddy
Posts: 2
Joined: Fri Mar 10, 2006 4:14 pm

Many Thanks....

One more question... I assume I can write this DLL or EXE in any programming language ?? I see from the documentation that C is used... I hope this is not the only language !!! :shock:
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,
I assume I can write this DLL or EXE in any programming language ??
Well, yes and no because:
- Visual Basic requires the VB Runtime (which may not be available on all machines)
- Java cannot be used to create EXE or DLL files (unless you use a program which generates native code from Java bytecode; or if you create a wrapper EXE/DLL, but this will still require the JVM)
- .NET languages require the .NET Framework
- Delphi is a good choice, but avoid using the VCL (since you would have to link with the runtime packages and this will increase the size of your EXE/DLL dramatically)

The recommended method would be to write a C/C++ EXE/DLL Custom Action that uses the ODBC or ADO APIs:
http://msdn.microsoft.com/library/defau ... erview.asp
http://msdn.microsoft.com/library/defau ... erview.asp

Note that ADO (ActiveX Data Objects) APIs are exposed through an Automation Interface and thus they can be used from within scripting languages such as VBScript or JScript:
http://msdn.microsoft.com/library/defau ... script.asp

Hope this helps.

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”