in reply to Win32::OLE enumeration syntax?

Okay, no takers thus far...

Here's the basic question:

use strict;
...
my $querydef;
...
my $recordset = $querydef->OpenRecordset(?, ?, ?, ?);
Given that each ? is an enumeration already defined in the type library (described above), what is the correct syntax needed to keep the Perl interpreter happy?

j

Replies are listed 'Best First'.
Re: Re: Win32::OLE enumeration syntax?
by NetWallah (Canon) on Nov 24, 2003 at 04:52 UTC
    Browsing the Microsoft ActiveX Data Objects Recordset 2.7 Library using the perl OLE browser reveals, at the root level the Enum RecordTypeEnum, which has the values adCollectionRecord adSimpleRecord and adStructDoc (Numeric equivalents are 1,0 and 2). ).

    Getting these constants into perl is mildly tricky:

    >perl -e "; use Win32::OLE::Const 'Microsoft ActiveX Data Objects Reco +rdset 2.7 Library'; print adSimpleRecord . qq(\n) . adColl ectionRecord .qq(\n) . adStructDoc . qq(\n);" -- Results -- 0 1 2
Re: Re: Win32::OLE enumeration syntax?
by jdporter (Paladin) on Nov 24, 2003 at 00:35 UTC
    When I get stumped in situations like this, I usually just look up the actual numeric value and stick that in. And put the enum value name in a comment, so the reader knows what's going on.

    jdporter
    The 6th Rule of Perl Club is -- There is no Rule #6.