SQL SCRIPT ERROR - 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!

udayk
Posts: 126
Joined: Thu Jan 19, 2012 12:30 pm

SQL SCRIPT ERROR

Hi Guys,

I have an error regarding SQL Script running through advanced installer.

But it should not delete DATABASE,

I apply command in Script file like this
USE [DATABASENAME]
DROP DATABASE DATABASENAME


this command work in editor, but not execute through script file.

Can any once please help about this issue.
is there any support for drop database using script.

Thank you,
Udayk.
Attachments
Attache screen shot for drop script running
Attache screen shot for drop script running
Script-error.png (54.82 KiB) Viewed 13845 times
udayk
Posts: 126
Joined: Thu Jan 19, 2012 12:30 pm

Re: SQL SCRIPT ERROR

Hi Team,

I resolved the above ERROR,

I Have a doubt regarding script running after while Uninstallation, if i perform the scripts at uninstall mode it will show an error

ODBC Connection timed out exception.
I give 60 sec for connection establishment.

How sould i resolve this error.

Thank you,
Udayk.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: SQL SCRIPT ERROR

Hi Udayk,

Here's a similar thread you can try to follow:
http://www.advancedinstaller.com/forums ... 290#p49492

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
udayk
Posts: 126
Joined: Thu Jan 19, 2012 12:30 pm

Re: SQL SCRIPT ERROR

Hi Mihai,

You send a link to alternative approach for resolving ODBC connection timed out exception.

In that link

Read the values of the properties from the registry

When running the installation in Maintenance mode (the "Modify", "Repair" and "Remove" options) the package must have access to the username and password. In order to improve the functionality, this information should be stored in the USER and PASSWORD properties..


But, I want to run Drop script while Removing application, regarding this process i want execute scripts in installation and uninstallation mode, don't want modify and repair.

How should i resolve this????????

Thank you,
Udayk.
udayk
Posts: 126
Joined: Thu Jan 19, 2012 12:30 pm

Re: SQL SCRIPT ERROR

Hi Mihai,

As you suggested me to a link, for run SQL Scripts while uninstalling the MSI.

I follow the Procedure, create registry and assign property, after installing the MSI USERNAME_PROP and PASSWORD_PROP should be stored in registry.
I rename the key's and create the Search level for those registry's, i check the test search after installation those are available in registrys.

suggested link having this information, after this what can i do. In this simply say (set Properties during the first installation can be used during Maintenance).

But How should i use these properties while uninstalling MSI.

Can you please tell me.

Read the values of the properties from the registry

When running the installation in Maintenance mode (the "Modify", "Repair" and "Remove" options) the package must have access to the username and password. In order to improve the functionality, this information should be stored in the USER and PASSWORD properties..

For this you can follow these steps:

go to the Search page and create a new search
use the "Add Location" context menu to add the Registry as the search location
in the Registry Location Properties section set the registry value in which the installation wrote the username information (for example, retrieve the raw value from HKEY_LOCAL_MACHINE\SOFTWARE\Your Company\Your Application\Username)
rename the search to USER (the name of the search is actually the name of the property which stores the result of the search)
do the same for the password (you will search for the "Password" registry value in the same key and the search will be named PASSWORD)

This way the Username and Password set during the first installation can be used during Maintenance.


Thank you,
Udayk.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: SQL SCRIPT ERROR

Hi Udayk,
But, I want to run Drop script while Removing application, regarding this process i want execute scripts in installation and uninstallation mode, don't want modify and repair.
Maintenance includes the package removal or uninstallation as you put it. By adding the values to the registry they will be available during maintenance. You cannot store those properties only for uninstall but you can access them only during uninstall.
But How should i use these properties while uninstalling MSI.
After implementing the article you can use the search names in your uninstall connection string.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
udayk
Posts: 126
Joined: Thu Jan 19, 2012 12:30 pm

Re: SQL SCRIPT ERROR

How should I access it, to establish a connection.

you said this!.. how should i search names in my uninstall connection string.

Is it necessary for any regards Connection Strings.

Please tell me briefly..

Thank you,
Mihai.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: SQL SCRIPT ERROR

Hello,

All you need to do is add a couple of searches with the name:

Code: Select all

USERNAME_PROP
and

Code: Select all

PASSWORD_PROP
if you have the same names for the public properties in your connection string:

Code: Select all

Driver=[\{][ODBC_RES_PROP][\}];Server=[SERVER_PROP];Port=[PORT_PROP];Uid=[USERNAME_PROP];Pwd=[PASSWORD_PROP];
Step 1: If it's the first time install the USERNAME_PROP and PASSWORD_PROP public properties will be set from user interaction( SQLConnectionDlg ).
Step 2: During install store the data from USERNAME_PROP and PASSWORD_PROP public properties in registry
Step 3: During uninstall the searches will be performed and store the result in their search names( which are in fact public properties ).

In both cases( install and uninstall ) USERNAME_PROP and PASSWORD_PROP will have the required value.
Also, if any of the other public properties referenced in the connection string are resolved correctly the error shouldn't occur.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
udayk
Posts: 126
Joined: Thu Jan 19, 2012 12:30 pm

Re: SQL SCRIPT ERROR

Let me try it Mihai,

Thank you,
Udayk.
udayk
Posts: 126
Joined: Thu Jan 19, 2012 12:30 pm

Re: SQL SCRIPT ERROR

Hi Mihai,

Thanks for your reply, really sorry about new posts.

I am Creating 3-reg keys with name DBNAME_PROP, USERNAME_PROP and PASSWORD_PROP

DBNAME_PROP: XXXXXXXX
USERNAME_PROP: XXXXXX
PASSWORD_PROP: XXXXXX

These 3 reg keys having some values after entering details through SQLConnectionDlg.

I have the same names for the public properties in my connection string:

Driver=[\{][ODBC_RES_PROP][\}];Server=[DBNAME_PROP];Port=[PORT_PROP];Uid=[USERNAME_PROP];Pwd=[PASSWORD_PROP];

Step 1: If it's the first time install the USERNAME_PROP and PASSWORD_PROP public properties will be set from user interaction( SQLConnectionDlg ).
Step 2: During install store the data from USERNAME_PROP and PASSWORD_PROP public properties in registry

Searches are:-

DBNAME_PROP Root: HKEYU_LOCAL_MACHINE
Key : SOFTWARE\Analytix On Demand\Analytix On Demand\DBNAME_PROP
Name: DBNAME_PROP
Type : Retrieve the raw value.

i created like this for USERNAME_PROP and PASSWORD_PROP

First step and Second step is successfully completed mihai, all the values should be stored into the reg, and search with the name as same as your post.

Again I have an ODBC: timeout exceeded

Step 3: During uninstall the searches will be performed and store the result in their search names( which are in fact public properties ).

above search scenario sufficient for execution of Step:3.

Please reply me.

Thank you,
Udayk.
udayk
Posts: 126
Joined: Thu Jan 19, 2012 12:30 pm

Re: SQL SCRIPT ERROR

Hi Mihai,

When can i expect reply.........

I don't know what i am wrong, if i was unable to send aip file because this is 3 MB file that's why .

can you please give me your mail id, then i will post to my aip file.

1. I will attach my screen shot for execute sql scripts at uninstall mode
2. I will attach my screen shot for searches for through get registry values.
3. i will attach my screen shot for registry values of my sql connection after installation.

I don all the things what said............
Please tell me, what am i wrong........ to run sql scripts while uninstall mode.....

Thank you.
Udayk.
Attachments
i will attach my screen shot for registry values of my sql connection after installation.
i will attach my screen shot for registry values of my sql connection after installation.
registry.png (52.65 KiB) Viewed 13759 times
I will attach my screen shot for searches for through get registry values.
I will attach my screen shot for searches for through get registry values.
search.png (23.5 KiB) Viewed 13760 times
I will attach my screen shot for execute sql scripts at uninstall mode
I will attach my screen shot for execute sql scripts at uninstall mode
drop1.png (34.08 KiB) Viewed 13760 times
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: SQL SCRIPT ERROR

Hi Udayk,

The steps I posted describe the functionality in big lines.

When working with properties and data like this a best practice is to keep track of your values( debugging the functionality ).
In this case make sure the connection string is correct before trying out the connection.

You can display the connection string in a text control on a dialog before using it to establish the connection. This way you can debug it and make sure it has a correct value.

I believe the search result format must be parsed before placed in the connection string:
http://www.advancedinstaller.com/user-g ... rties.html

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
udayk
Posts: 126
Joined: Thu Jan 19, 2012 12:30 pm

Re: SQL SCRIPT ERROR

Hi Mihai,

Display the connection string in a text control on a dialog before using it to establish the connection.

I have a doubt regarding text control of connection string, for example:- text control is wrong how should we establish connection while installation.

How and where should i parse the search results format before placed in the connection string???

I haven't use any search result till now.... that'swhy i am asking Mihai....

please tell me, i haven't understand about search results.....

Thank you,
Udayk.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: SQL SCRIPT ERROR

Hi Udayk,
How and where should i parse the search results format before placed in the connection string???
You can do this by developing your own custom action. You can schedule it to be executed after the search and before the connection attempt.
I have a doubt regarding text control of connection string, for example:- text control is wrong how should we establish connection while installation.
I don't fully understand what you mean by this, but to make sure the property values are correct you have to debug the connection string.

Steps are:

1. Get values from registry

2. Debug the connection string where the public properties( search names ) are referenced
At this point you will find out if you are using a connection string with wrong information or syntax.

3. Create and add the custom action that parses the public properties
The debug text control showing the connection string from step 2. will keep track whether the parse was successful or not

4. After assuring the connection string is correct you should be able to establish the connection

If you are trying to connect using a wrong connection string you will get error results like before.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
udayk
Posts: 126
Joined: Thu Jan 19, 2012 12:30 pm

Re: SQL SCRIPT ERROR

Hi Mihai,

Good response and good description for my requirement thank you,

I will attached the screen shots to explain the scenario for what i am done.

RESULT_PROPERTY_1 = public property is =[DBNAME_PROP] value is "PROCESS2\SQLEXPRESS"
RESULT_PROPERTY_2 = public property is =[USERNAME_PROP] values is "sa"
RESULT_PROPERTY_3 = public property is =[PASSWORD_PROP] value is "sa@123"


Thank you,
Udayk.
Attachments
After Installation of, if i open the AIP file and go to Search page run Test search, i think it is successful why because i found values from registry after installation.<br />That means while the un installation mode Search properties can find those registry keys and get values, hope fully.   This screen shot for public property USERNAME_PROP. I found the value in Test search.
After Installation of, if i open the AIP file and go to Search page run Test search, i think it is successful why because i found values from registry after installation.
That means while the un installation mode Search properties can find those registry keys and get values, hope fully. This screen shot for public property USERNAME_PROP. I found the value in Test search.
username.png (83.81 KiB) Viewed 13760 times
After Installation of, if i open the AIP file and go to Search page run Test search, i think it is successful why because i found values from registry after installation.<br />That means while the un installation mode Search properties can find those registry keys and get values, hope fully.   This screen shot for DBNAME_PROP
After Installation of, if i open the AIP file and go to Search page run Test search, i think it is successful why because i found values from registry after installation.
That means while the un installation mode Search properties can find those registry keys and get values, hope fully. This screen shot for DBNAME_PROP
Domain-Server.png (90.82 KiB) Viewed 13760 times
I created reg-keys for my server credentials, parsing public properties in New value why because if i enter some value in the SQLConnectionDlg those values are stored with the help of public properties, is there any thing need to create reg-keys for DRIVER and PORT
I created reg-keys for my server credentials, parsing public properties in New value why because if i enter some value in the SQLConnectionDlg those values are stored with the help of public properties, is there any thing need to create reg-keys for DRIVER and PORT
reg-keys.png (25.94 KiB) Viewed 13760 times
Last edited by udayk on Fri Feb 17, 2012 10:51 am, edited 1 time in total.

Return to “Common Problems”