Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Perl & ADORecordsets

by Solo (Deacon)
on Sep 13, 2006 at 20:52 UTC ( #572816=note: print w/replies, xml ) Need Help??

in reply to Perl & ADORecordsets

In general, you want to thoroughly read the Win32::OLE documentation. The Roth books also have useful info for this type of Perl on Win32 work.

Here is code I've used in the past to get you started, YMMV with newer versions of ADO.

use Win32 qw( in ); my $ConnStr = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Se +curity Info=False;Data Source=server;Initial Catalog=database;"; my $AdoConn = new Win32::OLE("ADODB.Connection"); $AdoConn->Open($ConnStr); my $AdoRs = new Win32::OLE("ADODB.Recordset"); my $sql = "select * from table"; $AdoRs->Open($sql, $AdoConn); ROW: while (!$AdoRs->{EOF}) { my @col; for my $field ( in $AdoRs->Fields ) { push @col, $field->{Value}; } # ... } continue { $AdoRs->MoveNext(); } $AdoRs->Close();


You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

Replies are listed 'Best First'.
Re^2: Perl & ADORecordsets
by merrymonk (Hermit) on Sep 14, 2006 at 07:09 UTC
    Many thanks for the information sources and the
    'starter' code.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://572816]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2022-05-18 12:15 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (70 votes). Check out past polls.