lazar5
Posts: 3
Joined: Mon Nov 07, 2022 1:40 pm

Test SQL Connection always successful

Hello everyone, I have a problem with my installer so that when I get to the page where I have to apply the connection string details, and I leave them empty, I have a button Test SQL Connection, which will return a status of 'Connection successful' even if they input fields are empty.
Image
Here is what happens in the actual installation if I click on 'Test SQL Connection' and the connection string are empty Image
The conditions in the first picture Connection unsuccessful with condition SqlConnectionOK = "0" is added due to the following documentation - https://www.advancedinstaller.com/user- ... tion.html where it says for the Output property it will be set to 0 if connection fails.
Shouldn't Test Connection return to me Connection unsuccessful if the connection string is empty as in the picture above?

Thank you in advance.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Test SQL Connection always successful

Hello,

Please note that there are two connections type in SQL Server - "SQL Server Authentication" and "Windows Authentication".

If you let those fields empty, the later one will be used automatically which does not require a username and a password.

If you input a wrong username and password, it will result in an unsuccesful conneciton.

Hope things are clearer now!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
lazar5
Posts: 3
Joined: Mon Nov 07, 2022 1:40 pm

Re: Test SQL Connection always successful

Hello Catalin,

In my case, there would be no need of a windows authentication (which requires no username or password), I always have to input username and password. Can I somehow specify this behaviour, meaning always to focus on the SQL Server Authentication which requires a username and password?

Thank in advance,
lazar.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Test SQL Connection always successful

Hello lazar,
Can I somehow specify this behaviour, meaning always to focus on the SQL Server Authentication which requires a username and password?
I'm afraid not.

However, what we could do using the "Dialog Editor" feature is to condition the "Next" button of the SQL Dialog to be disabled until the user inputs something in the fields - this would result in the same output as you want.

We can simply have two "Control Conditions" as it follows:

- Disabled if --> either property is empty

it would looke something like this:

Code: Select all

(NOT PROP_1) OR (NOT PROP_2)
- enabled if --> both properties have a value (i.e. the customer has typed something in there)

Code: Select all

PROP_1 AND PROP_2
Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Test SQL Connection always successful

You are always welcome, Richard! :)

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

Return to “Common Problems”