Discussion:
INSERT query using WiRunSQL.vbs
(too old to reply)
eelisdotnet
2005-07-13 12:49:04 UTC
Permalink
Hi

I'm trying to automate post-build updates to the MSI file. The UPDATE query
worked fine, but I have an error on the INSERT query.
The INSERT query is as follows:

Cscript WiRunSQL.vbs Setup.msi "INSERT INTO Registry
(Registry.Registry,Registry.Root,Registry.Key,Registry.Name,Registry.Value,Registry.Component_)
VALUES
('R__ConfigFileRegistry','1','Software\[Manufacturer]\[ProductName]\Config','[_C764143EC7AD42D1BE743AC87204C0E0]','C__00FBFDC77D25406F9F3B6C49E297693F')"


The error is :

Msi API Error 80004005: OpenView,Sql
1:2227 2:Setup.msi 3:Key 4: INSERT INTO Registry ... (all the query syntax)

Error 2227 is defined as: Database: [2]. Invalid identifier '[3]' in SQL
query: [4].
in the following MSDN >
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/windows_installer_error_messages.asp)

I couldn't track any invalid identifier in the 'Key' value nor in
'Registry' value on the query. Furthermore, the raw was successfully added to
the Msi using Orca and hard-code.

Any suggestions..... thanks!
legalize+ (Richard [Microsoft Windows Installer MVP])
2005-07-13 21:28:44 UTC
Permalink
[Please do not mail me a copy of your followup]
Post by eelisdotnet
I'm trying to automate post-build updates to the MSI file. The UPDATE query
worked fine, but I have an error on the INSERT query.
Cscript WiRunSQL.vbs Setup.msi "INSERT INTO Registry
(Registry.Registry,Registry.Root,Registry.Key,Registry.Name,Registry.Value,Registry.Component_)
VALUES
('R__ConfigFileRegistry','1','Software\[Manufacturer]\[ProductName]\Config','[_C764143EC7AD42D1BE743AC87204C0E0]','C__00FBFDC77D25406F9F3B6C49E297693F')"
What happens when you take the 'Registry.' prefix off all the column
names in the parenthesized list?
--
"The Direct3D Graphics Pipeline"-- code samples, sample chapter, FAQ:
<http://www.xmission.com/~legalize/book/>
Pilgrimage: Utah's annual demoparty
<http://pilgrimage.scene.org>
eelisdotnet
2005-07-14 05:46:01 UTC
Permalink
I tried the query without the 'Registry.' prefix in the column names. Now I
got error no. 2232: "Database: [2]. Unexpected token '[3]' in SQL query:
[4]." where [3] is still 'Key'. When I wrapped all column names and the table
name with apostrophes ('), it generated error no. 2227 again with 'Registry'
as invalid identifier.

Is the error comes from the column name (checked against the MSDN DB tables
reference) or from the values entered (that were previously hard-coded
successfully) ?
Post by legalize+ (Richard [Microsoft Windows Installer MVP])
[Please do not mail me a copy of your followup]
What happens when you take the 'Registry.' prefix off all the column
names in the parenthesized list?
--
<http://www.xmission.com/~legalize/book/>
Pilgrimage: Utah's annual demoparty
<http://pilgrimage.scene.org>
dbareis@NoSpam.labyrinth.net.au
2005-07-14 05:59:20 UTC
Permalink
Ok my long version got killed by google here is the short one.

try backwards single quotes (below escape) key. either :

`Registry`.`Key` or `Registry.Key` etc

Bye,
Dennis Bareis
eelisdotnet
2005-07-14 06:21:01 UTC
Permalink
Thanks Richard and Dennis.

Problem was in fact the grave accent marks `` to escape table and column
names that clash with SQL keywords. I used the apostrophe single quote which
should be used only for the Values.

Stefan Krüger from the installsite.org forum has cleared up this issue for
me, and I suggest that it will be noted more clear in the MSDN such as in the
query examples page:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/examples_of_database_queries_using_sql_and_script.asp
Post by ***@NoSpam.labyrinth.net.au
Ok my long version got killed by google here is the short one.
`Registry`.`Key` or `Registry.Key` etc
Bye,
Dennis Bareis
Loading...