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

WI API SQL syntax


3 replies to this topic

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 18 October 2005 - 18:04

Owing to the sporadic inability of Wise Installation Manger's "Report by Feature" facility to correctly report file sizes, my client has asked me to build a VB Script to do the job. The script reports on file or registry entries (that's all the client is interested in for this project) options for which are user-selectable via command line switches.

The script, loosely based on WiFeatur.vbs from the MS Platform SDK, works flawlessly EXCEPT when I add an 'ORDER BY' clause, when I get this:

Msi API Error 80004005: OpenView,Sql
1: 2227 2: C:\Bin\Custody\456_0001\NSPIS_Custody.msi 3: Registry 4: SELECT `Registry`.`Component_`,`Registry`.`Root`,`Registry`.`Key`,`Registry`.`Name
`,`Registry`.`Value` FROM `Registry` WHERE `Registry`.`Component_` = 'ntsvc.ocx' ORDER BY 'Registry'.'Component_'

The cause is NOT the fact that there are no entries to report for the component 'ntsvc.ocx', because without the ORDER BY clause, the script works.

Can anyone tell me what's wrong with the syntax, which is what the error 2227 means, according to http://msdn.microsof...r_messages.asp:
Database: [2]. Invalid identifier '[3]' in SQL query: [4].

I've tried it with and without the table name prefix (i.e. "ORDER BY 'Registry'.'Component_'" and "ORDER BY 'Component_'", I've changed the column used (again, with and without table name prefix), but always get 2227 error

- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 18 October 2005 - 23:22

ORDER BY expects a field, not an identifier. Try using the field quotes:
[...] ORDER BY `Component_`

If you create a verbose log, you can look up the values of [2], [3] and [4] inside the log, telling you which identifier is in error.

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 19 October 2005 - 08:26

Thanks for the reply, but I'm afraid you misundersxtand. I'm not RUNNING the MSI so the log thing is erroneous: I'm using the Installer object in script, using SQL syntax to obtain detail from the tables.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 19 October 2005 - 12:39

Sorry, I thought this was a Custom Action. I never figured out how to get the [2] [3] etc. parameters programmatically, so I can't help you there.

Still, try changing the quotes, as the current query has a syntax error.