in reply to Perl/MS SQL tutorial?
#!/usr/local/bin/perl -w use strict; =head Win32::OLE using a System DSN called testconn Objectives: Read stuff from an MSAccess database to prove that thi +s works Error handling tests =cut use OLE; my $Conn = CreateObject OLE "ADODB.Connection"; $Conn->Open("DSN=testconn"); my $RS = $Conn->Execute("Select * from Customers"); if (!$RS) { my $Errors = $Conn->Errors(); my $error; foreach $error (keys %$Errors) { print $error->{Description}, "\n"; } } while(!$RS->EOF) { print $RS->Fields('CustomerID')->value, "\n", $RS->Fields(2)->value,"\ +n"; $RS->movenext(); } 1;
I suppose you can look around for more information on Win32::OLE on the web. The perldoc includes more examples on how to access Microsoft Excel.
Celebrate Intellectual Diversity
|
|---|