TAC has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to use indexing service in a batch program. I have just started playing with it and I need some guidance. I am using ixsso.dll and I emulate some VB code and things have not worked as expected. Here is some sample code (remember this is a rudimentary atempt):
use strict; use Win32::OLE; #Set in Ixsso.query my $catalogPath = "d:\\resumes"; my $ixssoQueryRef; my $ixssoUtilRef; eval{ my $classId = "ixsso.query"; $ixssoQueryRef = Win32::OLE->new($classId); $ixssoUtilRef = Win32::OLE->new("IXSSO\.Util"); #Commented out if(0){ my $conn = Win32::OLE->new('ADODB.Connection'); my $test = Win32::OLE->new('ADODB.Recordset'); $conn->Open('provider=msidxs'); } #$test = $Win32::OLE->QueryObjectType($ixssoQueryRef); my $queryString = "<some query string>"; $ixssoQueryRef->Catalog($catalogPath); $ixssoQueryRef->Query($queryString); $ixssoQueryRef->MaxRecords(1); $ixssoQueryRef->AllowEnumeration(0); $ixssoQueryRef->Dialect("1"); $ixssoUtilRef->AddScopeToQuery($ixssoQueryRef, "\\", "deep"); $test = $ixssoQueryRef->CreateRecordSet("nonsequential"); }; if($@){ print "Error: $@\n"; }
I get a reference to the object but when I attempt to execute the querey I get undef. I imagine it could be the way the query string was structured. Should I scrap the above aproach and use as an ADO connection? Any assistance that anyone can provide will be very helpful... Thanks

Replies are listed 'Best First'.
Re: Indexing service
by rchiav (Deacon) on Jul 17, 2001 at 19:32 UTC
    I've never used ADODB the way that you're attempting to.. and I don't know if this will solve your problem or not. But I'd personally use the 'ADODB.Recordset' to perform the query. Here's what I'd attempt..
    my $conn = Win32::OLE->new('ADODB.Connection'); my $rs = Win32::OLE->new('ADODB.Recordset'); $conn->{'ConnectionString'} = 'provider=msidxs'; $conn->Open; $rs->Open($queryString, $conn); #define $queryString beforehand
    Then I'd pass $rs to Data::Dumper to see how everything is structured.

    Hope this helps..
    Rich