Ira Rainey
Posts: 4
Joined: Mon Jul 20, 2009 11:28 am
Contact: Website

SQL trusted connection problem when running script

I've created an installer (Using AI 7.0.1 Enterprise) which browses available SQL Servers on the network and then tests the connection selected, using either trusted connection or a supplied username and password before moving onto the next dialog. That all works fine. However, then at the next stage it runs a SQL script against the selected server using the same connection details. This is where the problem occurs.

I have two SQL Servers setup in my dev environment, one on the dev machine and one on a server. In both cases they are configured to use trusted connection, and my user account has admin rights.

If I provide a username and password for the connection then all is fine and the script runs both on the local machine or on the server, but if I use trusted connection, whilst the testing of the ODBC connection works fine for either server, when it gets to the script running part while it runs fine on the local machine, the connection fails to get made by the ODBC driver against the server.

The SQL script connection is set to use the USERNAME_PROP and PASSWORD_PROP, but as I understand it if SqlTrustedConnection is set and USERNAME_PROP and PASSWORD_PROP are NULL then trusted connection is used.

It looks to me as though there is an issue with the script connection element and the ODBC driver passing the wrong info.

Do you recognise this as a bug, or am I missing something?

Here's the error that comes up running the script - but this is after the connection has been tested using the same trusted connection status:
sql_conn_error.png
sql_conn_error.png (10.97 KiB) Viewed 5893 times
Ira

side lane : digital development
http://www.sidelane.co.uk
Bogdan
Posts: 2791
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: SQL trusted connection problem when running script

Hi,

Go to SQL Scripts page → select "Database Server",i.e. the first element of the tree → right click on it → check/uncheck “Impersonate Installing User” option. If not checked this option, check it and try to see if it works. If it doesn't try with the option unchecked.

If the problem still persists please send us the .aip file to support at advancedinstaller dot com.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ira Rainey
Posts: 4
Joined: Mon Jul 20, 2009 11:28 am
Contact: Website

Re: SQL trusted connection problem when running script

That's fixed it. It was unchecked, so I checked it and now it works fine.

Return to “Common Problems”