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!

chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Show an error Dialogue when TestODBC connection(custom action) fails

Hi,
Thanks for the support.
As per my installation, I want to restore the MS-Sql Database. To do so
1. I am using SQL Connection Dialogue.
2. defined a custom action TestODBCConnection.
3. if the data entered (IN SQL Connection dialogue) is correct the connection succeed all is fine .
BUT IF NOT
3(a) it still proceeds the installation [ IT SHOULD NOT ]
3.(b) I want to give an error dialogue that your connection parameters are wrong .
3.(c) It should not proceed with installation .

Please let me know how to achive it .
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: Show an error Dialogue when TestODBC connection(custom action) fails

Also this is what t have given in published events in the next button of SQLConnectionDailogue .

** See the screenshot.
Attachments
Capture.PNG
Capture.PNG (13.23 KiB) Viewed 5956 times
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Show an error Dialogue when TestODBC connection(custom action) fails

Hello,

The sample project is attached to this thread, so if you are interested to take a look directly at my project, you are more than welcome to download the ZIP file.

The user is prompted to enter the server to connect to and select the authentication method (Windows Authentication or SQL Authentication). If the test connection fails, the user is prompted with an error.
Also, the user is allowed to select an existing database or to create a new one. In the sample script code, if the database does not not exist, it will be created.

If you have any questions, please let me know.

Best regards,
Dan
Attachments
Test SQL Connection Sample and Create New Database.zip
(5.95 KiB) Downloaded 626 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: Show an error Dialogue when TestODBC connection(custom action) fails

Hi Dan,
Thanks for the reply, I am sry i think you don't get it what i am asking.

I am able to test the ODBC connection, And getting a message also that "Username/Password is wrong and so on . But once i click on the Popup it goes and installs, But it should not . It should throw an error dialogue .
I have followed this guide : - http://www.advancedinstaller.com/user-g ... ction.html
In this guide it is there that "Edit the existing Display a specific dialog published event on this button and set its condition to: SqlConnectionOK = "1". This will prevent the installation wizard to continue if the connection parameters are incorrect."
But i don't find any property as SQLConnection=ok anywhere

This is simply what i want :-
1. A dialogue which asks for Connection parameters. [ ABLE TO ACHIEVE IT USING SqlConnectionDailogue ]
2. using the entered parameters authenticate the credentials [ Able to achieve it using the guide provided ]
3. It should give a popup message that your credentials are wrong [ ABLE TO ACHIEVE IT ISUNG SAME GUIDE ]
4. Post clicking the popup when it gives an message that "credentials are wrong the installation continue [ UNABLE TO HOLD INSTALLATION HERE OR SHOW AN SPECIFIC DIALOGUE ]

I am giving you the screenshots of the next button published events . Please help me with this . also i don't able to get/understand from where i can find this SqlConnectionOK = "1". Property .


Thanks for the support .
Attachments
Capture.PNG
Capture.PNG (13.23 KiB) Viewed 5924 times
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Show an error Dialogue when TestODBC connection(custom action) fails

Hello,
4. Post clicking the popup when it gives an message that "credentials are wrong the installation continue [ UNABLE TO HOLD INSTALLATION HERE OR SHOW AN SPECIFIC DIALOGUE ]
Most likely the events are not in the right order. In order to further investigate this, please send us the .AIP(project file) to support at advancedinstaller dot com. If it contains confidential information you can send us a small test project which reproduce this behavior.

The events are executed as they appear and their execution is top-bottom. However, the display a specific child dialog and display a specific dialog are executed reverse from bottom-top as they appear in the published event list.

So, the most bottom published event you should display the dialog when the credentials are not correct. Of course, this dialog should be displayed when the connection string is not correct. The event that display the next dialog should be added on top. Also, you should only proceed with the next dialog if the connection string is correct (e.g. SqlConnectionOK = "1").

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: Show an error Dialogue when TestODBC connection(custom action) fails

Hi Den,
Thanks for the reply, I am trying to understand and implement your solution But This is something i am unable to find .
In this guide it is there that "Edit the existing Display a specific dialog published event on this button and set its condition to: SqlConnectionOK = "1". This will prevent the installation wizard to continue if the connection parameters are incorrect."
But i don't find any property as SQLConnection=ok anywhere



Please help .
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Show an error Dialogue when TestODBC connection(custom action) fails

Hello,

The SqlConnectionOK = "1" is a condition referring to the return value of the TestODBCConnection custom action. If the connection is successfully, then the SqlConnectionOK property will be set with 1.

Please take a look on the Test SQL Connection article with related information for hints and guidance.

If you need any help, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”