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

Re: Check SQL Connection

Hi,

I have emailed you now with the attached Test Aip. I have also attached the main Aip so that if you need to check that aswell you can.

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

Re: Check SQL Connection

Hi Matt,

I have looked into your test AIP and it seems you didn't have the TestODBCConnection custom action added in the Custom Actions Page. Please do so and add another published event on the "Next" button after setting the SqlConnectionString:
Name:DoAction
Argument:TestODBCConnection


This and any detailed information about how to build your test project are described in our step by step user guide tutorial.

After completing the above, you can retest the connection with the connection string that reflects the settings from the SQL Scripts Page.

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,

This has worked in the Test Aip. Now we need to get it working in the actual Aip. I am asuming that as all the settings I left are standard there is a problem with the Arugment on the [SqlConnectionString] Event. However I have had a developer look at this and not spot any faults.

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

Re: Check SQL Connection

Hi Matt,

You can copy your test project's settings( maybe use the same SqlConnectionString ) into your main one. If one project works, then the same logic should apply for the main 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 tried the connection string in the main Aip and it still didnt work. I have swapped the connection string however I need to hard code the Port number into the connection string and I think that is were the issue is. However if you look at the log extract below it populates the string

Code: Select all

MSI (c) (B4:E4) [09:27:55:078]: PROPERTY CHANGE: Adding SQLConnectionString property. Its value is 'Driver={SQL Server};Server=localhost; Port={1433};Uid=Sa;Pwd=SQL123fidd;'.
My Connection String is

Code: Select all

Driver=[\{]SQL Server[\}];Server=[DB_SERVER]; Port=[\{]1433[\}];Uid=[DATABASE_USER];Pwd=[DB_PASSWORD];
My Test Connection String is

Code: Select all

Driver=[\{]SQL Server[\}];Server=[SERVER_PROP];Port=[PORT_PROP];Uid=[USERNAME_PROP];Pwd=[PASSWORD_PROP];
Matt
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check SQL Connection

Hi Matt,

You can try to use a public property with a defined default value instead of hardcoding the port number like that.

In this case :

Code: Select all

Port=[\{]1433[\}]
the port will resolve to :

Code: Select all

{1433}
To learn about formatted strings please follow this link.

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,

Thats ok but can you tell me what the best way to start trouble shooting might be? and what the settings should roughly be as I left all the settings as Default on the custom action.

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

Re: Check SQL Connection

Hi Matt,

All you need to do for the custom action to work is to have the same resolved connection string from the test project( which works ) onto your main project and then execute the custom action.

Another approach would be to add a "Custom SQL Connection" from the SQL Scripts Page along with some database changes. If the changes occur on your SQL Server, then the connection was implicit successful and you can assign the SqlConnectionString property with the same connection string value of your custom SQL 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 looked at the custom action on both the Test.Aip and the actual.Aip and the settings and the setup is exactly the same on both so the custom action should work. The only thing that is differnt is the Argument for the [SQLConnectionString] Published event.

The Actual Aip arguement is:

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

The Test Aip Arguemnet is:

Driver=[\{]SQL Server[\}];Server=[SERVER_PROP];Port=[PORT_PROP];Uid=[USERNAME_PROP];Pwd=[PASSWORD_PROP];

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

Re: Check SQL Connection

Hi Matt,

Can you please try the following connection string

Code: Select all

Driver=[\{]SQL Server[\}];Server=[DB_SERVER];Port=1433;Uid=[DATABASE_USER];Pwd=[DB_PASSWORD];
like I suggested above?

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 this and it still doesn't work. Same thing happens again.

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

Re: Check SQL Connection

Hi Matt,

On what OS(s) does this behavior manifest? Does the behavior manifest only several machines or is it just the one?

Please send us the main project( .AIP ) and a verbose log of the installation to support at advancedinstaller dot com one more time 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,

So far I have only used it on a Win7 machine and a Server 2008r2 machine. I will attach a log and an Aip to an email to the said address.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check SQL Connection

Hi Matt,

I have looked into your .AIP and everything should work fine if provide valid SQL information on the following fields at install time:
  • Dialog : enTrader_Database_Settings
    Control : "SQL Server Instance" text field ( DB_SERVER )
  • Dialog: Database_Settings
    Controls : "Database Username" and "Password" text fields ( DATABASE_USER and DB_PASSWORD )
Also, the published events ordering on the "Next" button from the Database_Settings dialog is wrong. Since the event's priority is top bottom in the list, the order should be:
correct events order.jpg
correct events order.jpg (13.47 KiB) Viewed 12322 times
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 changed the order on the next button now. it is still not working. I am putting the correct information into the fields you suggested at the install and it still wont progress past the next button. The only thing I can think of is the hard codeing of the ports / Driver. The driver part of the connection string = Driver=[\{]SQL Server[\}] and the port bit = Port=1433;Uid Should they be set out the same? 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 is below.

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

Matt

Return to “Common Problems”