MGS
Posts: 83
Joined: Tue Oct 04, 2022 9:52 am

present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Tue Oct 04, 2022 11:29 am

Hello,
i need to present a database table data in user controls like combo boxes(later on for single records in edit fields too). I Found an example for accessing database tables in advanced installer online help ( htps://www.advancedinstaller.com/user-guide/tu ... query.html), but it does not describe how to add the items as a ID / value pair. it only attaches one property to the control called QUERY-PROP. suppose we have this SELECT statement: Select ID, DESCRIPTION FROM MYTABLE
I succeed in either adding the ID or the DESCRIPTION, but I want the DESCRIPTION to be shown in the control and the item data should get the ID.
Later on, when the user selects one of the items, I want to get back the selected item ID.
How can this be done?
best regards,
MGS

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Tue Oct 04, 2022 12:01 pm

Hello and welcome to our forums,

From what I can see, you already have a thread on this subject with my colleague Daniel over the email.

If possible, let's try to avoid duplicate threads. My colleague Daniel will answer you over the email when he will be done with the investigation.

If you have other questions, please feel free to either post them here or email us at support at advancedinstaller dot com and we will gladly assist.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MGS
Posts: 83
Joined: Tue Oct 04, 2022 9:52 am

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Tue Oct 04, 2022 12:17 pm

Hello,
Here or there, there is no problem, but I hope to respond as soon as possible, as I have been looking for a solution to the problem for days, and I have not found a way.
Thanks in advance.
Best Regard
MGS

MGS
Posts: 83
Joined: Tue Oct 04, 2022 9:52 am

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Wed Oct 05, 2022 10:43 am

Hello,
Thank you for sending an answer with a sample solution via email.
So far I have succeeded in connecting sql query with combo box. And I have each ID and DESCRIPTION lists in two different COMBO BOX. The problem is that when I wanted to move these two lists into one LIST BOX, I only got the first item from the first COMBO BOX. And a problem with writing that appears inside all buttons as of ListBoxDlg.
attached the fotos.
I appritiate each help.
Attachments
onlyOneItemInListBox&pushButtonNameProblem.png
onlyOneItemInListBox&pushButtonNameProblem.png (23.07KiB)Viewed 246347 times
pushButtonControlNextPublishedEvents.png
pushButtonControlNextPublishedEvents.png (20.68KiB)Viewed 246347 times
2ComboBoxTabellen.png
2ComboBoxTabellen.png (22.47KiB)Viewed 246347 times

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Wed Oct 05, 2022 11:02 am

Hello,

As previously mentioned, please continue the thread over the email with my colleague Daniel, so we avoid duplicate threads - there is no point in two members working on the same ticket.

If you have a different question, then you can create a new thread on the forums or over the email.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MGS
Posts: 83
Joined: Tue Oct 04, 2022 9:52 am

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Mon Oct 10, 2022 8:09 am

Hello Catalin,
Can we end this work here? My colleague who sent you an email has been unavailable for a while. In that case, I will send you an attachment of the AI project.
Thank you very much in advance.

With kind regards

Mayssa

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Mon Oct 10, 2022 11:10 am

Hello Mayssa,

From what I can see, the last question over the email and here was how to extract the data from the controls.

My colleague Daniel has created the following sample project that achieves that:
sample.aip
(25.53KiB)Downloaded 1914 times
(this was created with version 19.9 of Advanced Installer)

The above sample uses two "Extract Listbox data" custom actions, together with a PowerShell and "Populate ListBox" custom actions to achieve what you need.

If you have any questions, please let us know.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MGS
Posts: 83
Joined: Tue Oct 04, 2022 9:52 am

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Mon Oct 10, 2022 12:39 pm

Hi,
Thank you very much for your quick reply :D .
As you mentioned, I followed the form sent by your colleague Daniel. But unfortunately it did not work for me. I tried a lot and could not figure out what was wrong with my work :roll: . I am sending you the sample of the project file I implemented. Please take a look at it.
Thank you very much in advance.
With kind regards

Mayssa
Attachments
mySample.aip
(83.67KiB)Downloaded 1984 times

MGS
Posts: 83
Joined: Tue Oct 04, 2022 9:52 am

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Tue Oct 11, 2022 2:39 pm

Hello,
Hope to get an answer soon.
I wish you best regards


Mayssa

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Tue Oct 11, 2022 3:19 pm

Hi Mayssa,

Please give me some time to review your setup project and I will get back to you once I have a conclusion.

Thank you for your understanding on this.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Wed Oct 12, 2022 12:38 pm

Hi Mayssa,

Can you please test the attached modified version of your "mySample.aip" setup project and let me know how this works for you?
mySample.aip
(82.87KiB)Downloaded 1966 times
Basically here are the changes I have done:

1. go to "Dialogs" page and select "Published Events" list on [Next>] button (on "SQLConnectionDlg" dialog)

2. delete all the below selected events
screen1.jpg
screen1.jpg (254.07KiB)Viewed 245764 times
3. go to "SiteSelectionDialog" and select the "Published Events" list on [Next>] button; modify the second event to execute the "ExtractComboBoxData" action instead of the "ExtractListBoxData"

4. also delete the "Refresh the current dialog" event
screen2.jpg
screen2.jpg (226.19KiB)Viewed 245764 times
5. go to "ListBoxDialog" and select the "Published Events" list on list box control; delete the "Refresh the current dialog" event

6. save and rebuild your setup project

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MGS
Posts: 83
Joined: Tue Oct 04, 2022 9:52 am

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Mon Oct 17, 2022 11:55 am

Hello Daniel,
Thanks for the help, so far I was able to get the required list in following your example that you sent :P .
I just have a small problem that the writing in the buttons appears as in the screenshot.
Please help me to solve this problem. Notes that this appear in only one dialog. All other dialogs are normal.
Thank you very much.
With kind regards

Mayssa
Attachments
wrongTexts.png
wrongTexts.png (31.92KiB)Viewed 244760 times

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Wed Oct 19, 2022 10:13 am

Hi Mayssa,

This is actually caused by a small issue in our tool. Thank you for bringing this to our attention:

To get this working please proceed like this:

1. go to "Dialogs" page and select one of those controls (e.g. [Next] button

2. in the right pane click on the translation (flag icon) button
screenshot.jpg
screenshot.jpg (174.78KiB)Viewed 244476 times
3. select the "Never translate" option and click [OK]

4. proceed the same for the rest of your misbehaving controls

5. save and rebuild your setup project

Hope this helps.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MGS
Posts: 83
Joined: Tue Oct 04, 2022 9:52 am

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Mon Oct 24, 2022 8:08 am

Hello Daniel,

yes, that works. thank you very much.

with kind regards

Mayssa

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: present a database table data in user controls like combo boxes(later on for single records in edit fields too)

Mon Oct 24, 2022 8:28 am

You are always welcome Mayssa!

Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”