#!/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 this 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;