This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Reading/Editing SQL Scripts Schema Version
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 04, 2009
12:28 AM
Reading/Editing SQL Scripts Schema Version
Hi all,
Is it possible to manually manipulate a row in InstallShield table in database created by Installshield (e.g. reading it from the table & put the value to a property, or adding a new row, etc)?
Thanks in advance.
Is it possible to manually manipulate a row in InstallShield table in database created by Installshield (e.g. reading it from the table & put the value to a property, or adding a new row, etc)?
Thanks in advance.
(9) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 04, 2009
08:57 PM
Any idea? :confused:
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 05, 2009
09:53 AM
You can update the InstallShield table by executing sql commands. The following is a sample code that will add the value of 3.0.0 to the ISSchema column of the InstallShield table.
[Code]INSERT INTO [dbo].[InstallShield] (ISSchema) VALUES('3.0.0')[/Code]
[Code]INSERT INTO [dbo].[InstallShield] (ISSchema) VALUES('3.0.0')[/Code]
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 05, 2009
07:58 PM
Thanks hidenori... How about reading it? Maybe I should use SELECT statement, but if so, where the selected value will be stored?
Thanks.
Thanks.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 05, 2009
10:24 PM
You should be able to store in a local variable as follows. Please consult with the MSDN for more information.
Declare @local_variable As char(15)
SELECT @local_variable=ISSchema FROM InstallShield ORDER BY ISSchema ASC
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 13, 2009
01:58 AM
hidenori wrote:
You should be able to store in a local variable as follows. Please consult with the MSDN for more information.Declare @local_variable As char(15)
SELECT @local_variable=ISSchema FROM InstallShield ORDER BY ISSchema ASC
I mean, can we store the query result into an installer property (eg. DB_SCHEMA_VERSION), so we can make use of the value within installshield (eg. in installscript as in MsiGetProperty("DB_SCHEMA_VERSION", schemaVer, size))
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 13, 2009
11:02 PM
Unfortunately, the built-in InstallShield SQL feature currently does not support the ability that you are looking for. At this time, you will need to write your own InstallScript code that will manage connections and execute your SQL scripts in order to accomplish your requirement. There are many sample code posted in this community forum. Please take a look at this thread as a starting point.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 18, 2009
04:53 AM
Thanks for your advise hidenori.
Btw, I tried the following script to test:
This script returns me a message box with empty error message and an error icon, which I suspect coming from the MessageBox in 'catch' block. Any part I did wrongly?
PS: the WMDBVersion only has one column and one row. The IP, database name, user, and password are all correct.
Btw, I tried the following script to test:
function CheckDbSchemaVersion(hMSI)
STRING server, user, pwd, dbname, sqlCmd, connStr;
OBJECT adoConn, adoCmd, adoRecordSet;
begin
set adoConn = CreateObject("ADODB.Connection");
connStr = "Driver={SQL Server};Server=10.32.7.147;Database=databasename;Uid=sa;Pwd=password";
try
adoConn.Open(connStr);
adoRecordSet = CreateObject("ADODB.Recordset");
adoRecordSet.CursorType = 3;
adoRecordSet.ActiveConnection = adoConn;
sqlCmd = "SELECT Version FROM DbSchemaVersion";
adoRecordSet.Open(sqlCmd);
MessageBox(adoRecordSet.RecordCount, INFORMATION);
catch
MessageBox(Err.Description, SEVERE);
endcatch;
end;
This script returns me a message box with empty error message and an error icon, which I suspect coming from the MessageBox in 'catch' block. Any part I did wrongly?
PS: the WMDBVersion only has one column and one row. The IP, database name, user, and password are all correct.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 19, 2009
10:21 AM
Did you try debugging into the code to see which line is causing the exception?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 22, 2009
10:55 PM
OK solved, my mistake 🙂
I added "set" keyword before "adoRecordSet = CreateObject("ADODB.Recordset");" and it works
Thanks
I added "set" keyword before "adoRecordSet = CreateObject("ADODB.Recordset");" and it works
Thanks
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)