Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

INSERT query using WiRunSQL.vbs


2 replies to this topic

eelisdotnet

eelisdotnet
  • Members
  • 24 posts

Posted 13 July 2005 - 14:28

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:
CODE

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

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!

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 13 July 2005 - 18:02

Try this instead:
CODE
´Registry´.´Key´

KEY is a SQL keyword so this might clash with the column name.
Here's a quote from help topic SQL Syntax:
QUOTE
To escape table names and column names that clash with SQL keywords, enclose the name between two grave accent marks `` (ASCII value 96). If a column name must be escaped and is qualified as {tablename.column}, then the table and the column must be escaped individually as {`tablename`.`column`}. It is recommended that all table names and column names be escaped in this fashion to avoid clashes with reserved words and gain significant performance.


eelisdotnet

eelisdotnet
  • Members
  • 24 posts

Posted 14 July 2005 - 07:32

Thanks Stefan!

It was indeed the grave accent marks. I used first the apostrophe (single quote) char that should be used only for the Values.
Well, I think it should be noted more clear in the MSDN.
guess I wasn't paying too much attention to that tiny grave accent... rolleyes.gif

Cheers!!! smile.gif