/build/static/layout/Breadcrumb_cap_w.png

Open a windows installer file using VB

Hi

I am trying to Open a Windows Installer database file using VB6.
I have included the refrences "Windows Installer Object Library" (msi.dll)

when I run the following code

Dim objWI As WindowsInstaller.Installer
Dim objDB As WindowsInstaller.Database
Set objDB = objWI.OpenDatabase("[pathof msi]",0)

I get an error saying "Object variable or With block variable not set ".

What could be the mistake on my part???

Thanks

0 Comments   [ + ] Show comments

Answers (1)

Posted by: TomB 18 years ago
Orange Belt
0
I think you have to set the objects.


Dim objWI
Dim objDB
Dim Database

Const msiOpenDatabaseModeReadOnly = 0
Const msiOpenDatabaseModeTransact = 1

Set objWI = Createobject("WindowsInstaller.Installer")
Set objDB = Createobject("WindowsInstaller.Database")

Set Database = objWI.OpenDatabase("pathtomsi",msiOpenDatabaseModeTransact)


This at least works in my scripts.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ