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

Re: Check SQL Connection

Hi,

I have changed the New Dialog event on the Database Settings Dialog to AI_Install and this allows me to click next and get past this point. The string that I replaced was SqlConnectionOK = "1"

This means that there is a problem with the string that should when you click next send you onto the next dialog.

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

Re: Check SQL Connection

Hi Matt,
This means that there is a problem with the string that should when you click next send you onto the next dialog.
I'm afraid I don't understand what you mean by this. Can you please give us more details?

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 narrowed the problem down to the connection string for the Action that opens the next dialog page. I removed the SqlConnectionOK = "1" Connection String and replaced it with AI_Install When I ran the install this worked. So I am guessing that the problem is with the Connection string that should take you to the next dialog. any Ideas?


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

Re: Check SQL Connection

Hi Matt,
I have narrowed the problem down to the connection string for the Action that opens the next dialog page. I removed the SqlConnectionOK = "1" Connection String and replaced it with AI_Install When I ran the install this worked.
The SqlConnectionOK = "1" is a condition referring to the return value of the TestODBCConnection custom action, not a connection string. This means that the connection string you assigned the SqlConnectionString property before executing the custom action must be the wrong one.

I recommend you start a new Advanced Installer project and implement only the functionality described in this tutorial. You can use the parameters that established a connection to SQL outside the installer to set the SqlConnectionString property.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check SQL Connection

Hi Matt,
I have narrowed the problem down to the connection string for the Action that opens the next dialog page. I removed the SqlConnectionOK = "1" Connection String and replaced it with AI_Install When I ran the install this worked.
The SqlConnectionOK = "1" is a condition referring to the return value of the TestODBCConnection custom action, not a connection string. This means that the connection string you assigned the SqlConnectionString property before executing the custom action must be the wrong one.

To more precise I am referring to the published event with these options( the Argument option is just a generic example ):
* Name: [SqlConnectionString]
* Argument: Driver=[\{][ODBC_RES_PROP][\}];Server=[SERVER_PROP];Port=[PORT_PROP];Uid=[USERNAME_PROP];Pwd=[PASSWORD_PROP];
* Condition: 1 (it will be showed as AI_INSTALL)

I recommend you start a new Advanced Installer project and implement only the functionality described in this tutorial. You can use the parameters that established a connection to SQL outside the installer to set the SqlConnectionString property.

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,

Sorry about the multiple replys about roughly the same thing It didnt say that it had posted the comments and I couldnt find them so Posted them again anyway. Is there another way other than starting a fresh to solve this issue as it has taken me a long time to build this project and I don't really want to start a fresh if I dont have to.

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

Re: Check SQL Connection

Hi,

I have been looking at the log again and the TESTODBCConnection Custom action finishes ok and gives a return of "1" this means that this is finishing properly. However does this mean that the Published event is finishing properly as I can't see a return code for it. I have tried hard coding the argument in the published events but still not working. Can you check to make sure that I have typed it out correctly and not missed a space or somthing? The info is below. I have also copied the log in below.

Published Events

Event: NewDialog
Argument: enTrader_Initial_System_Administrator_Settings
Condition: SqlConnectionOK = "1"

Event: [SQLConnectionString]
Argument: Driver=SQL Server;Server=(Local);Port=1433;Uid=SA;Pwd=SQL123fidd;
Condition: AI_Install

Event: DoAction
Argument: TestODBConnection
Condition: AI_Install
Screenshot of Dialogs Page
Screenshot of Dialogs Page
Dialogs.PNG (238.07 KiB) Viewed 14367 times

Log Extract

Action 10:30:24: FolderDlg.
Action start 10:30:24: FolderDlg.
MSI (c) (C0:20) [10:30:24:515]: Note: 1: 2205 2: 3: AI_ControlEx
MSI (c) (C0:20) [10:30:24:562]: Note: 1: 2228 2: 3: AI_ControlEx 4: SELECT `Dialog_`,`Control`,`Type`,`Attributes`,`Data` FROM `AI_ControlEx` WHERE `Dialog_` = 'enTrader_Service_Settings'
MSI (c) (C0:A4) [10:30:25:358]: PROPERTY CHANGE: Modifying SERVICENAME property. Its current value is '[AppNAME]_[App_Environment]_Service'. Its new value: 'enTrader_TEST_Service'.
MSI (c) (C0:20) [10:30:25:389]: Note: 1: 2205 2: 3: AI_ControlEx
MSI (c) (C0:20) [10:30:25:420]: Note: 1: 2228 2: 3: AI_ControlEx 4: SELECT `Dialog_`,`Control`,`Type`,`Attributes`,`Data` FROM `AI_ControlEx` WHERE `Dialog_` = 'enTrader_Database_Settings'
MSI (c) (C0:B4) [10:30:45:155]: PROPERTY CHANGE: Adding DB_SERVER property. Its value is 'MSSQLSERVER'.
MSI (c) (C0:B4) [10:30:45:171]: PROPERTY CHANGE: Adding DB_NAME property. Its value is 'enTrader'.
MSI (c) (C0:B4) [10:30:45:186]: PROPERTY CHANGE: Adding EUP property. Its value is '**********'.
MSI (c) (C0:B4) [10:30:45:186]: PROPERTY CHANGE: Adding SBP property. Its value is '**********'.
MSI (c) (C0:20) [10:30:45:202]: Note: 1: 2205 2: 3: AI_ControlEx
MSI (c) (C0:20) [10:30:45:249]: Note: 1: 2228 2: 3: AI_ControlEx 4: SELECT `Dialog_`,`Control`,`Type`,`Attributes`,`Data` FROM `AI_ControlEx` WHERE `Dialog_` = 'Database_Settings'
MSI (c) (C0:C8) [10:30:50:491]: PROPERTY CHANGE: Adding DATABASE_USER property. Its value is 'Sa'.
MSI (c) (C0:C8) [10:30:50:522]: PROPERTY CHANGE: Adding DB_PASSWORD property. Its value is '**********'.
MSI (c) (C0:C8) [10:30:50:522]: PROPERTY CHANGE: Adding SQLConnectionString property. Its value is 'Driver=SQL Server;Server=MSSQLSERVER;Port=1433;Uid=SA;Pwd=SQL123fidd;'.
Action ended 10:30:50: FolderDlg. Return value 1.
MSI (c) (C0:54) [10:30:50:537]: Doing action: TestODBCConnection
Action 10:30:50: TestODBCConnection.
Action start 10:30:50: TestODBCConnection.
MSI (c) (C0:B0) [10:30:50:600]: Invoking remote custom action. DLL: C:\Users\matts\AppData\Local\Temp\MSI2947.tmp, Entrypoint: TestSqlConnection
Action ended 10:30:50: TestODBCConnection. Return value 1.
MSI (c) (C0:54) [10:30:50:725]: Doing action: Database_Settings
Action 10:30:50: Database_Settings.
Action start 10:30:50: Database_Settings.

Matt
Attachments
AdvancedInstallerLog.txt
Log File
(48.34 KiB) Downloaded 538 times
Screenshot of Custom Action
Screenshot of Custom Action
CustomAction.PNG (60.82 KiB) Viewed 14367 times
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check SQL Connection

Hi Matt,

Your settings seem to be in place.

However, in my last post I didn't suggest you replicate every setting from your project on a fresh copy.
I suggested to replicate only the functionality described in our tutorial because I suspect the issue is not originating in Advanced Installer.

My logic is that if you can connect with a package built by a fresh project which reflects only the exact settings from our tutorial, you could compare the test project with your main one and see the mistake.
If the test project doesn't work either, then most likely the connection string is wrong, or your SQL Server settings need a review.
You can also use the test project as a test functionality assurance. If the test project works then the same settings must work on your main project as well.

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 am creating another advanced installer project now to test this however in the process I noticed that I am using a predifined connect not a custom connection for the SQL Scripts will this make a difference? I have attached a screen shot of SQL screen.

Matt
Attachments
SQL Connection
SQL Connection
SQLConnection.PNG (56.46 KiB) Viewed 14359 times
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check SQL Connection

Hi,

I have just created another project and have come accross the same problem as before where when you click next nothing happens. I have not added the Connection Timeout part with the custom action.

I have attached a screen shot of the settings I have setup.

The Arguement for the [SQLConnectionString] is Driver=[\{]SQL Sever[\}];Server=[SERVER_PROP];Port=[PORT_PROP];Uid=[USERNAME_PROP];Pwd=[PASSWORD_PROP];

I have also attached the log file.

Matt
Attachments
Advanced Installer Log.txt
Log File
(21.69 KiB) Downloaded 624 times
Screenshot
Screenshot
Test.PNG (104.94 KiB) Viewed 14359 times
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check SQL Connection

Hi Matt,
The Arguement for the [SQLConnectionString] is Driver=[\{]SQL Sever[\}];Server=[SERVER_PROP];Port=[PORT_PROP];Uid=[USERNAME_PROP];Pwd=[PASSWORD_PROP];
Should be :

Code: Select all

Driver=[\{]SQL Server[\}];Server=[SERVER_PROP];Port=[PORT_PROP];Uid=[USERNAME_PROP];Pwd=[PASSWORD_PROP];
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,

The Problem still occurs. The log entry is below.

Code: Select all

Action 12:47:02: SQLConnectionDlg. Dialog created
MSI (c) (2C:78) [12:47:08:167]: PROPERTY CHANGE: Adding SERVER_PROP property. Its value is '(local)'.
MSI (c) (2C:78) [12:47:10:304]: PROPERTY CHANGE: Adding PORT_PROP property. Its value is '1433'.
MSI (c) (2C:78) [12:47:12:769]: PROPERTY CHANGE: Adding DATABASE_PROP property. Its value is 'Tesy'.
MSI (c) (2C:78) [12:47:18:279]: PROPERTY CHANGE: Modifying DATABASE_PROP property. Its current value is 'Tesy'. Its new value: 'TEST'.
MSI (c) (2C:78) [12:47:19:449]: PROPERTY CHANGE: Adding USERNAME_PROP property. Its value is 'Sa'.
MSI (c) (2C:78) [12:47:22:444]: PROPERTY CHANGE: Adding PASSWORD_PROP property. Its value is '**********'.
MSI (c) (2C:78) [12:47:22:475]: PROPERTY CHANGE: Adding SqlConnectionString property. Its value is 'Driver={SQL Server};Server=(local);Port=1433;Uid=Sa;Pwd=SQL123fidd;'.
Could it be anything to do with the SQL Connection I have made? As my connection is a predifined one not a custom one. Also is there a timeout limit?

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

Re: Check SQL Connection

Hi Matt,

The connection looks fine and you can set the timeout limit on the same page. This being the case, the problem doesn't lie in the Advanced Installer project settings but in in your connection string parameters or your SQL Server settings.
You should ask someone with SQL experience to help you set your SQL Server according with your project needs. After assuring everything is OK on the SQL side, you can use the tutorial project you recently built to test your connection.

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 had a SQL programmer who to look into this and the info that I am entering is correct for instance the Database user, Password and Server are all correct. He also checked the Connection string and said he didnt see any problems with it. How ever the Event [SQLConnectionString] Still is not giving an error return code so the Condition SqlConnectionOK = "1" is not able to allow you to progress. I have changed the order in which the events execute and this made no difference. I also tried moving the SqlConnectionOK = "1" Condition to the Verifyinstall_Dlg to see if it that would work and it still does exactly the same. I have tried making changes on both my actual project and the test project and still not getting anywere.

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 failing test AIP to support at advancedinstaller dot com so we can investigate it?

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

Return to “Common Problems”