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
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)
Please log in to answer
Posted by:
TomB
19 years ago
I think you have to set the objects.
This at least works in my scripts.
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.
so that the conversation will remain readable.