in reply to Perl & ADORecordsets
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl & ADORecordsets
by merrymonk (Hermit) on Sep 14, 2006 at 07:09 UTC |