apajovejohn
Posts: 19
Joined: Tue Dec 18, 2018 6:11 pm

Create Database activity fails

Tue Dec 18, 2018 6:19 pm

Hi All,
I'm trialling AI currently. I've tried creating a project from our existing WIX environment and am having some success, I certainly prefer working with AI than I do with WIX!

But, I have a problem with the database script.

no matter what functional script I provide, the installer always reports a SQL script error.

Today I have created a package with just the in-built SQLServerConnectionDLG dialogue and the resulting SQL connection config. I added a single script with a single line:

CREATE DATABASE [MyDatabase]

and this fails.

I can browse the SQL server list fine and I can test my connectivity to SQL, but no matter what scripts I provide the installer fails.
I've attached my basic installer to this message if anyone can help?

Thanks

John
Attachments
Your Application.aip
(22.02KiB)Downloaded 232 times

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

Re: Create Database activity fails

Wed Dec 19, 2018 10:16 am

Hello John and welcome to our forums,

First of all, thank you for trying out Advanced Installer and I am glad you enjoy it.

In what regards your issue, this may happen if you left the "Database" field empty upon installing (when you deploy the setup and the SQL dialog is spawned). Please keep in mind that you do not need to already have a database to connect to, since you have the "Create database if it does not exist" option set in "SQL Databases" page --> "DlgPredefinedConnection" --> under "Catalogue".

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

apajovejohn
Posts: 19
Joined: Tue Dec 18, 2018 6:11 pm

Re: Create Database activity fails

Thu Dec 20, 2018 10:44 am

Thanks so much Catalin, that was exactly it, can't believe I didn't think of that.

As we'll always be using the same database name, I imagine I can just default that value and hide the field on the form.

Thanks again

John

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

Re: Create Database activity fails

Thu Dec 20, 2018 12:08 pm

Hello John,

You are always welcome, I am glad I could help.

In what regards your second question, sure, that is possible. In order to achieve this, you can proceed as it follows:

- Please go to "SQL Databases" page --> "DlgPredefinedConnection" --> under "Catalogue" section in the "Database" field, enter the database name you desire.

- Now it is time to create a condition (so we can hide the controls based on a condition). To do so, please go to "Install Parameters" page and under "Properties" section, add a new property as it follows:

Code: Select all

Name: HIDE_CONDITION
Value: true
- Not it is time to create the "Control Operations" which will hide our controls in the "SQLServerConnectionDlg". In order to do so, please go to "Dialogs" page --> click on "SQLServerConnectionDlg" and proceed as it follows:

- Click on "Database:" static text
- Go to "Control Conditions" tab
- Press "New..." to create a new control condition as it follows:
*Condition: HIDE_CONDITION = "true"
*Action: Hide


- Click on "ComboBox" control
- Go to "Control Conditions" tab
- Press "New..." to create a new control condition as it follows:
*Condition: HIDE_CONDITION = "true"
*Action: Hide


- Click on "..." control
- Go to "Control Conditions" tab
- Press "New..." to create a new control condition as it follows:
*Condition: HIDE_CONDITION = "true"
*Action: Hide


Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”