Hello Guys,
Am trying to access the MSI database, I can insert, delete etc. in the database.
My issue is how to check for existing entry in the database and Insert if not exists.
I get error in my code below.
installer = CreateObject("WindowsInstaller.Installer")
database = installer.OpenDatabase(Path, 1) 'database will be opened for editing.
SQLquery = "IF NOT EXISTS(SELECT * FROM database WHERE `Feature` = 'Complete') INSERT INTO Feature (`Feature`, `Feature_Parent`, `Title`, `Description`, `Display`, `Level`, `Directory_`, `Attributes`) VALUES ('Complete', '', 'Complete', '', '2', '1', 'INSTALLDIR', '0' )"
View = database.OpenView(SQLquery) ---------> Error: COMException was Unhandled, OpenView,Sql
Please assist me in solving the error in the code.