Hi BrowserUK Thanks for your response, I no longer get that error so your solution worked. However, I am now having difficulty getting the record to update.

I have the following code which is not doing anything.

$MSIObject = CreateObject Win32::OLE 'WindowsInstaller.Installer'; if (defined ($MSIObject)) { print "Object Available\n"; $dbReference = $MSIObject->OpenDatabase("C:\\temp\\AppsenseApplica +tionManager.msi", 1); # Create SQL query to obtain required data $query = "SELECT * FROM Feature WHERE Feature = " . "'Agent'"; # Create a database view based on the query $view = $dbReference->OpenView($query); # Execute the query $results = $view->Execute(); # fetch the first data set based on the query $record = $view->Fetch(); if ($record) { for (my $loop = 0; $loop < $record->FieldCount(); $loop++) { print "Field = " . $loop . " = " . $record->StringData($lo +op) . "\n"; } } else { print "Record is undefined!\n" } $newRecord = $MSIObject->CreateRecord($record->FieldCount()); $newRecord->StringData(1, 'Agent2'); for (my $loop = 0; $loop < $newRecord->FieldCount(); $loop++) { print "New Record Field = " . $loop . " = " . $newRecord->Stri +ngData($loop) . "\n"; } $view->Modify(9, $newRecord); print "View Error = " . $view->GetError() . "\n"; $dbReference->Commit(); $view->Close(); $dbReference = undef; $reference = undef;


The $newRecord field one is empty even though I have set the StringData value.

Any further ideas? It must be something trivial again.

Cheers

Ant

In reply to Re^2: Help with OLE module and MSI files by perls_of_joy
in thread Help with OLE module and MSI files by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.