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();
--Solo
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.