Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have fixed my dumb mistakes and got to the place where I was getting an error message 'error 0x8002000e: 'Invalid number of parameters" ... CursorLocation' How many parameters is CursorLocation supposed to have? I thought there was only 1 parameter. I know there is only one in the VBScript implementation of ADODB. I can live with that error as it is not fatal. However, once inside the loop I can progress through the database using $rs->MoveNext, but I can't seem to find a way to get the data out of the record set. In VBScript I use rs.Fields("<field name>") (or in extended syntax rs.Fields("<field name>").value) to get my value of the field from the record set. I can seem to figure out the parallel syntax in Perl. Help! I've got a Monday morning deadline and child care that I'm doing all weekend. Thanks so very much#!perl -w use strict; use Win32::OLE; use constant adUseClient => 3; use constant adOpenKeySet => 1; my $db_connection = new Win32::OLE('ADODB.Connection'); my $rs = new Win32::OLE("ADODB.Recordset"); my $db_datasource = 'Driver={Microsoft Access Driver (*.mdb)};DBQ=I:\g +arbage\quarterback.mdb;'; # Connect to the database and tie the recordset object to the database print "Data Source = $db_datasource\n"; $db_connection->open($db_datasource); # Set the connection doohicky $rs->CursorLocation(adUseClient); $rs->Open('SELECT Item_ID, Item_Text, Answer_Text FROM Quarterback',$d +b_connection, 0, adOpenKeySet); while ( ! $rs->Eof ) { $rs->MoveNext; } ## end of while (! $rs-Eof ) $rs->close;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Read MS Access Memos with Win32::OLE ADODB
by Grygonos (Chaplain) on Sep 05, 2003 at 20:12 UTC | |
|
Re: Read MS Access Memos with Win32::OLE ADODB
by jand (Friar) on Sep 06, 2003 at 05:33 UTC |