Noob Question - SQL Server - 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!

redsoxfred
Posts: 7
Joined: Tue Oct 04, 2011 3:34 pm

Noob Question - SQL Server

Hi.

New here..

here is my problem.

I am trying to get the user to either

Choose an existing SQL Server

or

Install SQL Server Express

I need him to choose at least one.

I created a SQLConnectionDlg and I get the list of existing servers.

I would like if there are NO Available Server and SQL Express not installed on machine
that the Install SQL Server Express R2 be checked and ReadOnly and you can only navigate or cancel

If Sql server Express R2 is already installed on the machine, I would like the checkbox be unchecked and readonly

If I choose an existing server, I would like to capture the login info to use later.

Here is the dialog I have now


Image

thanks in advance for any help

Fred
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Noob Question - SQL Server

Hi Fred and welcome to Advanced Installer forums,

First of all you should add the Sql Server Express 2008 R2 predefined prerequisite from the Prerequisites page( top right -> Add ) and set it as feature based.
I would like if there are NO Available Server and SQL Express not installed on machine
that the Install SQL Server Express R2 be checked and ReadOnly and you can only navigate or cancel
- add an SetProperty init event:
[YOUR_CHECKBOX_PROPERTY]
Argument: Checked
Condition: NOT(AI_SQL_2008_R2_ORIGINAL_PREREQSEARCH_1_PROP AND AI_SQL_2008_R2_ORIGINAL_SEARCH_2_PROP AND YOUR_SERVER_BROWSE_RESULT_CONTROL)
where YOUR_CHECKBOX_PROPERTY and YOUR_SERVER_BROWSE_RESULT_CONTROL are the public properties attached to the afferent controls from your dialog.
If Sql server Express R2 is already installed on the machine, I would like the checkbox be unchecked and readonly
- add another SetProperty init event:
[YOUR_CHECKBOX_PROPERTY]
Argument: {}
Condition: AI_SQL_2008_R2_ORIGINAL_PREREQSEARCH_1_PROP AND AI_SQL_2008_R2_ORIGINAL_SEARCH_2_PROP

Since both your above requirements are for the checkbox to be readonly you can set its Enabled attribute to false from the right properties pane.
If I choose an existing server, I would like to capture the login info to use later.
The predefined server browse method only captures the following information( when using ODBC Driver Manager functionality ):

Code: Select all

ServerName\InstanceName;Clustered:No;Version:9.00.3042.00
All is detailed in this user guide article.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
redsoxfred
Posts: 7
Joined: Tue Oct 04, 2011 3:34 pm

Re: Noob Question - SQL Server

AI_SQL_2008_R2_ORIGINAL_PREREQSEARCH_1_PROP ...

Is this a Property that I have to create or does it exist.

If it does what does it mean

I googled AI_SQL_2008_R2_ORIGINAL_PREREQSEARCH_1_PROP nothing
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Noob Question - SQL Server

Hi,

This is a custom property used by our SQL Server 2008 R2 predefined prerequisite. After you add the prerequisite as feature-based, you can use the property like Mihai explained. You don't need to set or modify it, you should only check if it's set or not.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
redsoxfred
Posts: 7
Joined: Tue Oct 04, 2011 3:34 pm

Re: Noob Question - SQL Server

Which Value am I looking for if i want to see if the

SqlServerBrowseComboBox

has any items ?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Noob Question - SQL Server

Hi,

I'm not sure I understand what you mean. Can you please give me more details?
SqlServerBrowseComboBox is an installer property associated with a combo box. It's set to the selected combo box item value.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
redsoxfred
Posts: 7
Joined: Tue Oct 04, 2011 3:34 pm

Re: Noob Question - SQL Server

Yeah. Sorry about that.. guess I was a bit short.

I managed to fill a combo with the list of the available servers.

I am trying to determine if the combo has any items or if its empty.

-------------

I am also trying to find out what is the event that is fired when the Radio Group Value is changed.

I have a radio group with 3 radio buttons, and depending on the choice of the user, i want to hide or show some textboxes. Is that possible ?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Noob Question - SQL Server

Hi,
I am trying to determine if the combo has any items or if its empty.
Here's an article that explains how to work with combobox controls. The "Extract item values and text from ComboBox and ListBox controls" should clarify this.
I am also trying to find out what is the event that is fired when the Radio Group Value is changed.
Unfortunately, events can only be published by interacting with a button or checkbox on a dialog box. By enabling the Enahnced UI, the listbox control will also have publishing functionality.
I have a radio group with 3 radio buttons, and depending on the choice of the user, i want to hide or show some textboxes. Is that possible ?
You can set control conditions for the text controls for this purpose. Here is a sample project that demonstrates this functionality on NewDialog from FirstTimeInstall:
ControlConditionsTest.aip
(14.64 KiB) Downloaded 304 times
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
redsoxfred
Posts: 7
Joined: Tue Oct 04, 2011 3:34 pm

Re: Noob Question - SQL Server

Great, the radio button solution is exactly what I needed.
redsoxfred
Posts: 7
Joined: Tue Oct 04, 2011 3:34 pm

Re: Noob Question - SQL Server

I manage to move forward quite a bit this morning.

My next problem is as follow

I have 2 screen where I will need to choose a database (prod and demo)

I did the first screen by using the SqlServerDatabaseComboBox

my database are listed.

The second screen, if i use the same property, it obviously will use the same value. Since i want 2 values,

how can i have to combobox listings of the database attached to a chosen sql server.

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

Re: Noob Question - SQL Server

Hi,

You can try this approach:
- on the Next button of the first database dialog add a SetProperty control event which saves the SqlServerDatabaseComboBox property value in a custom property, for example DATABASE_1
- on the same button configure the database browse events, just like on the previous dialog
- on the Next button of your second database dialog use another SetProperty event to save the second database

This way each dialog browses the available databases and saves the selected one in a custom property. You can then use these two properties during install.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
redsoxfred
Posts: 7
Joined: Tue Oct 04, 2011 3:34 pm

Re: Noob Question - SQL Server

Thanks, I did and it works..

I am now perplexed by a strange behavior

I build a odbc connection string like this

Driver=[\{]SQL Server[\}];Server=[SERVER_PROP];Port=[PORT_PROP];Uid=[USERNAME_PROP];Pwd=[PASSWORD_PROP];

When I leave some fields Empty, for example, Username, if the rest is OK, the TestConnection works.

2nd.

I am trying to make sure that every field is filled before testing the connection

I created my custom dialogs, and they fire properly

However, the problem is that i want to stop the Test Odbc if any of those fields are missing.

I am having a hard time doing that.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Noob Question - SQL Server

Hi,

The username and password can be omitted if you established a trusted connection.

Here are a couple of articles to help you:
http://www.advancedinstaller.com/user-g ... field.html
http://www.advancedinstaller.com/forums ... =2&t=12174

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”