Check SQL Connection - Page 4 - Advanced Installer Community
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check SQL Connection

Hello Matt,
Also does the port number have to be in there as if it doesn't I could remove it and see if it works then.
The connection string for the custom action should reflect the settings from the SQL Scripts Page of the SQL connection you want to test.

This was one of my initial suggestions for resolving the matter. You can either have hard coded values or public properties with default values in the connection string. You can also use the test project you designed following our tutorial to verify the 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 Can have verified that the connection is ok using the test project but yet when I run the main project it fails. Also I have checked that the values in the SQL Connections match the values in the [SqlConnectionString] Argument. They match up ok but yet it is still failing. The only thing that I could see is that the Connection type on the SQL Connections is Microsoft SQL SQL Server/MSDE so is it worth changing that setting to MySQL?

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

Re: Check SQL Connection

Hi,

Just tried changed the setting to MySQL and still doesnt work so it is not that setting.

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

Re: Check SQL Connection

Hi Matt,
The only thing that I could see is that the Connection type on the SQL Connections is Microsoft SQL SQL Server/MSDE so is it worth changing that setting to MySQL?
Please note that MySql is not the equivalent of Microsoft SQL thus you should not change this setting if you are connecting to a Microsoft SQL database server.

Can you please send us a fresh verbose log of the installation 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,

The log file is attached.
Attachments
AdvancedInstallerLog_20110321.txt
Log File
(50.46 KiB) Downloaded 615 times
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check SQL Connection

Hello,

Although the SQL Server user login field is case insensitive starting with SQL Server 2005, please enter "sa" as the login name.

Also, you should use "(local)" instead of "localhost" since you are connecting to a Microsoft SQL Server.

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 tried logging in using lower case 'sa' and this still didnt work. I also tried using (local) instead of localhost but this has not worked either. If i use these in the test aip. it works ok.

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

Re: Check SQL Connection

Hi Matt,

Please use the same connection parameters in your test project and send us the verbose log generated from that.

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 late reply I have been out the office. The log file is attached.


Matt
Attachments
Advanced Install Log 20110328.txt
Log file
(50.44 KiB) Downloaded 513 times
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check SQL Connection

Hi,

Code: Select all

MSI (c) (B4:F0) [13:09:15:770]: PROPERTY CHANGE: Adding DB_SERVER property. Its value is '(loca)'.
MSI (c) (B4:F0) [13:09:15:786]: PROPERTY CHANGE: Adding DB_NAME property. Its value is 'enTrader'.
MSI (c) (B4:F0) [13:09:15:817]: PROPERTY CHANGE: Adding EUP property. Its value is '**********'.
MSI (c) (B4:F0) [13:09:15:833]: PROPERTY CHANGE: Adding SBP property. Its value is '**********'.
MSI (c) (B4:B0) [13:09:15:848]: Note: 1: 2205 2:  3: AI_ControlEx 
MSI (c) (B4:B0) [13:09:15:880]: Note: 1: 2228 2:  3: AI_ControlEx 4: SELECT `Dialog_`,`Control`,`Type`,`Attributes`,`Data` FROM `AI_ControlEx` WHERE `Dialog_` = 'Database_Settings' 
MSI (c) (B4:68) [13:09:20:092]: PROPERTY CHANGE: Adding DATABASE_USER property. Its value is 'Sa'.
MSI (c) (B4:68) [13:09:20:123]: PROPERTY CHANGE: Adding DB_PASSWORD property. Its value is '**********'.
MSI (c) (B4:68) [13:09:20:154]: PROPERTY CHANGE: Adding SQLConnectionString property. Its value is 'Driver={SQL Server};Server=;Port=;Uid=;Pwd=;'.
Action ended 13:09:20: FolderDlg. Return value 1.
MSI (c) (B4:C8) [13:09:20:216]: Doing action: TestODBCConnection
Action 13:09:20: TestODBCConnection. 
Action start 13:09:20: TestODBCConnection.
MSI (c) (B4:B0) [13:09:20:419]: Invoking remote custom action. DLL: C:\Users\matts\AppData\Local\Temp\MSI466A.tmp, Entrypoint: TestSqlConnection
Action ended 13:09:20: TestODBCConnection. Return value 1.
MSI (c) (B4:C8) [13:09:20:591]: Doing action: Database_Settings
Action 13:09:20: Database_Settings. 
Action start 13:09:20: Database_Settings.
This is the last fragment from your log file. Taken from above the SQLConnectionString property is set to:

Code: Select all

Driver={SQL Server};Server=;Port=;Uid=;Pwd=;
How can this create a working connection?

Please use the test project you built and mentioned it works to create a successful SQL connection and send us the verbose log generated from that. I want to confront the log generated from the working test project to the failing main one you already sent. Please use the same connection string parameters in both connection attempts.

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 used the Same connection string in the Main one as I did in the Test one and the log that the main one created was attached to my previous post. I have attached a log from the test aip this time. Also the reason why It is not populating anything in the log is because the variables used in the test aip are not the same as the ones used in the Main Aip.

Matt
Attachments
TestAipLog_20110328.txt
Test Aip Log
(117.42 KiB) Downloaded 608 times
nhewitt21
Posts: 1
Joined: Fri Aug 15, 2014 10:51 am

Re: Check SQL Connection

Hi Matt,

I was trying to do something very similar and too could not get this to work, same results as you, my log was returning SqlConnectionOK property to 1 just as yourself, and not matter what suggestion i tried from the how to guide or from this thread, i could not get it to work.

However, when looking at the log, something dawned on me, in the log I saw this:
PROPERTY CHANGE: Modifying SqlConnectionOK property. Its current value is '1'. Its new value: '0'.

I looked at that and though, hang on, the 1 is not a string, so SqlConnectionOk = "1" would never work.
I changed it to SqlConnectionOk = 1, ran some tests for failing and working connection, and i had success on both, this solved my issue.

I think yours could be similar if not same issue, perhaps give it a try see if it helps with your problem.

Return to “Common Problems”