SQL Connections and Running Scripts - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

proactis
Posts: 10
Joined: Thu Aug 04, 2011 11:36 am

SQL Connections and Running Scripts

I have followed the instructions for creating a screen that allows a user to choose whether to use SQL or Windows login, but I fail to get this to work.

http://www.advancedinstaller.com/user-g ... -type.html

I am trying to connect to the server then run a simple SQL script that will then create a database.

The error that I am receiving is

[SQLDriverConnect] {SQL_STATE: IM002}
[Microsoft][ODBC Driver Manager] Data source name
not found and no default driver specified
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: SQL Connections and Running Scripts

Hi,

Can you also try analyzing the following tutorial, to check the settings from your project.

If you cannot make it work after analyzing it please attach your project file on the forums or send it to us by e-mail at support at advancedinstaller dot com so we can take a look.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
proactis
Posts: 10
Joined: Thu Aug 04, 2011 11:36 am

Re: SQL Connections and Running Scripts

Hi there,

I don't think that link will allow me to use windows authentication.

D
proactis
Posts: 10
Joined: Thu Aug 04, 2011 11:36 am

Re: SQL Connections and Running Scripts

Here is the install file that I have tried to get to work without any success.

THanks

Darren
Attachments
SQL_Connection.aip
(14.33 KiB) Downloaded 402 times
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: SQL Connections and Running Scripts

Hi,

I recommended the tutorial so you can make sure the rest of the settings are correct, I know is not related to your authentication method.

I noticed you added a new driver in ODBC page but your connection is using the "SQL Server" one. Can you please try selecting your own driver?
Also, the correspondence for the server and database properties is broken, i.e. in SQL Scripts page you are using the properties DBSERVER_PROP, DBNAME_PROP while
in Dialogs page you are using the properties "SERVER_PROP" and "DATABASE_PROP".

You should first try the settings so you know for sure the default configuration works and then try to modify it for the desired authentication method.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
proactis
Posts: 10
Joined: Thu Aug 04, 2011 11:36 am

Re: SQL Connections and Running Scripts

What I want to achieve is have a screen that takes the parameters that I set, be it windows or sql authorisation then use these to connect to a database then run some sql scripts against that database.

All of which seems very difficult to get to work.

Do you have an example project that you can give me?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: SQL Connections and Running Scripts

The article which you've first mentioned contains a sample. Just follow this link.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
proactis
Posts: 10
Joined: Thu Aug 04, 2011 11:36 am

Re: SQL Connections and Running Scripts

I have downloaded the file, and changed it slightly, but it still refuses to work for windows authentication.

I have attached the install file and a word doc with the errors that I receive when using windows authentication
Attachments
SQLConnection.aip
(23.18 KiB) Downloaded 416 times
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: SQL Connections and Running Scripts

Hello,

There is no word document attached, only the .AIP.

The sample project is tested throughly and should work. Your modified project seems to be configured correctly.

Can you please make sure your credentials and settings work in a SQL management application? If they do, please use them to connect via the installer built with from the sample project( no modifications ) and see the outcome.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
proactis
Posts: 10
Joined: Thu Aug 04, 2011 11:36 am

Re: SQL Connections and Running Scripts

Here are the errors that I receive
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: SQL Connections and Running Scripts

Hi,

The attachment is probably not supported. Can you please send it to support at advancedinstaller dot com instead?
Also, please reply to my other suggestions as well.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
proactis
Posts: 10
Joined: Thu Aug 04, 2011 11:36 am

Re: SQL Connections and Running Scripts

Again
Attachments
errors.zip
(65.29 KiB) Downloaded 417 times
proactis
Posts: 10
Joined: Thu Aug 04, 2011 11:36 am

Re: SQL Connections and Running Scripts

Any other ideas why this won't work?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: SQL Connections and Running Scripts

Hello,

Can you please make sure your credentials and settings work in a SQL management application? If they do, please use them to connect via the installer built with from the sample project( no modifications ) and see the outcome.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
proactis
Posts: 10
Joined: Thu Aug 04, 2011 11:36 am

Re: SQL Connections and Running Scripts

ok, I have done and it works as sql statment but not installer

Return to “Common Problems”