Populating data from SQL database - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Mert
Posts: 50
Joined: Mon Jun 15, 2009 4:00 pm

Populating data from SQL database

Hi everyone I am currently working on a project and I need to get data from an SQL database and then enter a new entry to the database with the properties that user entered. I can connect to the database but can't find how to populate data from there to a combobox or listbox. So anyone knows how to do this please help me.

Thanks for the help
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Populating data from SQL database

Hi,

Unfortunately Advanced Installer doesn't support retrieving information from a database and setting it in a listbox or combo box. However, you can try using a custom action. Since the custom action needs to return the data to the installer, you can use a C++ DLL or VBScript file which sets some installer properties with the data you need. The values of these properties can be inserted in a combo box or list box by using the approach explained in the ComboBox and ListBox controls tutorial.

I'm afraid we don't have sample code for this.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Mert
Posts: 50
Joined: Mon Jun 15, 2009 4:00 pm

Re: Populating data from SQL database

Hmm ok but now I have another question.

Can it be done with a .net dll or does it have to be a C++ dll and can you describe how to write a DLL that can help me extract from database and write into database. I couldn't understand it from the serial validation dll example.

Thank you very much for your time
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Populating data from SQL database

Hi,
Can it be done with a .net dll or does it have to be a C++ dll
Unfortunately .NET DLLs cannot set installer properties, so the data read from the database cannot be returned to the installer.
can you describe how to write a DLL that can help me extract from database and write into database.
I'm afraid we don't have sample code for this. However, you can try using the ODBC API or you can search the web for sample code.
I couldn't understand it from the serial validation dll example.
Note that this example shows the structure of a C++ DLL custom action so you know how to create your DLL. It was not designed for what you need.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”