I am needing to read Memo fields from an MS Access database. Previous research has recommended that I not use ODBC as there is a 255 character limit. In a discussion on writing memo fields Simon.Proctor (Jan 6, 2002) recommended using OLE as the perferred method to write. I'm trying his OLE approach for reading. I don't get very far. My code is:
#!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;
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

In reply to Read MS Access Memos with Win32::OLE ADODB 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.