Hi Leila,
See if this helps:
--------------------------------
        $Conn = Win32::OLE->new('ADODB.Connection', sub {$_[0]->Close();})  # note 
destructor here !
                || die "CreateObject: $!";
        $Conn->Open ( $DSN, $UID, $PWD );     # There are also other ways to do it
        $SQL = "Select a, b, c from table_name where x=5";  # imaginary SQL
        $rs = $Conn->Execute($SQL);
        if ( ! $rs )
        {
                die "Error\n";   # Could not execute for some reason
        }
        $FeildName = 'a';  # MUST match one of with your fields in SQL statement
        if ( $rs->EOF() )
        {
                die "*** ERROR *** recordset is at EOF -- cannot get value of 
[$FieldName].\n";
        }
        $Field = $rs->Fields($FieldName);
        if ( ! $Field )
        {
                die "*** ERROR *** There is no field [$FieldName] in the recordset.\n";
        }
        $Value = $Field->{Value};
        print "Got value: [$Value]\n";
--------------------------------

I do massive SQL through ADODB/WIN32::OLE all the time. 
If you need more details - do not hesitate to ask.
Eugene Haimov.


-----Original Message-----
From: Leila Lappin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 6:26 PM
To: [EMAIL PROTECTED]
Subject: Recommendation for ADODB or Win32::OLE reference 


Hi all,

I need a source of information, either online or a
book, on how to update an Access table using
Win32::OLE and ADODB from a Perl script.  

Currently all I can do is SELECT * FROM table_name. I
cannot even query on specific fields, if I change the
query to name specific fields I get OLE exception from
"ADODB.Fields". looking through ASPN archives, I found
this to be a problem for a few other people but I
don't know how they resolved it. I think I need to
review documentation on how Win::OLE works since I
couldn't find any useful regarding ADO in my Access
book (Access Database by O'Reilly).  There's only a
few example and they're written with VBA syntax :-(

thanks all

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to