Check SQL Connection - Advanced Installer Community
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Check SQL Connection

Hi,

I would like Advanced installer to check the SQL Connection before it starts to install the Software onto a host as at the moment if you enter the password wrong or somthing you dont find out till it comes up with a SQL error halfway throug the install. I have Tried what has been said in the Following user Guide: http://www.advancedinstaller.com/user-g ... ction.html. However When I came to test this it didnt do anything I tried entering the User account wrong and the password ect.

I am not using the Default properties and I am not using the Defaul SQLConnectionsDlg. I have created my own Variables for Datebase Password, Database User Account, Database Name, Database Server Name.
I would like Advanced installer to Test the input into the boxes to make sure a connection can be created before it starts the install.

Please help

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

Re: Check SQL Connection

Hi Matt,

Can you please send us the .AIP (project) to support at advancedinstaller dot com so we can investigate it?

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check SQL Connection

Hi,

I have Sent an email with the Aip Attached to the address you specified.

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

Re: Check SQL Connection

Hi Matt,

I have looked into your AIP file and since you already have the text fields that collect the connection string data you will need to do the following:
  • Go to the Custom Actions Page and add the predefined UI Custom Action "Test ODBC Connection"
  • Go to Dialogs Page on the Database_Settings dialog, select the "Next" button and delete the [SQLConnectionString] "SetProperty" event
  • Add a new "SetProperty" event from the Published Events tab:
    Name:[SqlConnectionString]
    Argument:Driver=SQL Server;Server=[DB_SERVER];Port=1433;Uid=[DATABASE_USER];Pwd=[DB_PASSWORD];Database=[DB_NAME];
  • In the same list add a "DoAction" event set with "TestODBCConnection" argument. Make sure it is placed under the previous event in the events list
  • Edit the existing "NewDialog" 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.
For more information about the above settings please complete our "How to test SQL connection parameters?" step by step tutorial.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check SQL Connection

Hi Mihai,

I have followed the steps you gave me and I have just ran it and when I click next and Advanced installer should check the SQL Connection it doesn't do anything. I have tried entering the correct information and the incorrect information but still nothing.

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

Re: Check SQL Connection

Hi Matt,

For testing purposes you can make sure the information from the connection string are correct by using the SQL Management Studio. Also, you should complete our tutorial on a separate clean project and use that project against your own to discover the mistake.

If my above suggestions fail to solve the issue, can you please let us know on the outcome as well as sending us the new AIP to support at advancedinstaller dot com so we can further investigate?

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check SQL Connection

Hi Mihai,

I am sure the SQL Information i have inputted is workign ok this has been tested a lot of times and the SQL information works ok. The only problem is that since I have added the check Connection stuff in When I click next it does not allow me to progress onto the next Dialog so I am effectivly stuck at this point and can not progress past it to install. Could this issue be that the information is being enterd over 4 Pages and also that as a default the Text in the boxes are variables for Example Database name the Database name Box is filled by Default by the Variables [APPname]_[Environment].

Matt
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check SQL Connection

Hi Mihai,

I have Removed all the Default text that gets Defaulted into the boxes. This has not worked and the same problem occurs. Also another thing I have thought of the Argument for the [SQLConnectionsString] mentions a Database name. This Advanced installer installs a Database as part of the install and the [DB_Name] Variable is used to name that database. Therefore is it is checking to see if this database is there when it has not been created yet could this cause it to fail?

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

Re: Check SQL Connection

Hi Matt,
Therefore is it is checking to see if this database is there when it has not been created yet could this cause it to fail?
No, it isn't. Have you tried the connection string without specifying the database like in the tutorial?
Could this issue be that the information is being enterd over 4 Pages and also that as a default the Text in the boxes are variables for Example Database name the Database name Box is filled by Default by the Variables [APPname]_[Environment].
This shouldn't be an issue if you are using public properties( e.g. DB_Name is a private property as opposed to DB_NAME which is public ). If you are not sure about the content of the connection string you can display it in a text control or in a message box right before performing the connection test custom action.

Another approach would be to hardcode the information in the connection string when setting the SqlConnectionString property. Yet another approach would be to use our step by step tutorial and test the connection string on a separate project before implementing it into your own.

If all my above suggestions fail, please let us know the scenario in which they do and also send us the failing AIPs to support at advancedinstaller dot com so we can investigate them.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check SQL Connection

Hi,

I don't have the database in the connection string anymore the current connection string is:

Driver=SQL Server;Server=[DB_SERVER];Port=1433;Uid=[DATABASE_USER];Pwd=[DB_PASSWORD];

I have also tried hard coding the connection string with:

Driver=SQL Server;Server=MSSQLSERVER;Port=1433;Uid=SA;Pwd=Password123;

Still having the same issue. I am going to run the install locally and log what is happening.

Matt
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check SQL Connection

Hi,

Log file is attached. I have had a quick look through the log and it seems as though the custom action has worked fine but what ever I changed to create the check SQL custom action is causing it to freeze up at Database_Settings.

Matt
Attachments
AdvancedInstallerLog.txt
(48.34 KiB) Downloaded 634 times
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check SQL Connection

Извиняюсь что не в тему, подскажите где кнопка обратной связи, заранее спасибо.
I tried to translate this and it came out as
Sorry that is not the topic, tell me where the button feedback, thanks in advance.


Can you Explain what you mean please?

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

Re: Check SQL Connection

Hi Matt,

I apologize for the post. That was probably a spam message and we will deal with it accordingly. Please ignore it and I'll reply as soon as possible.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check SQL Connection

Hi,

Ok Thanks for the warning

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

Re: Check SQL Connection

Hi Matt,

I have looked into your log file and as you noticed yourself, the TestSQLConnection custom action indeed seems to be successful. I'm afraid we do not debug custom actions for our users but you can try this yourself and get past the crash.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”