Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Posts
    4

    Unanswered: Use OLE to connect MS Access with perl

    1) how do i install OLE? i installed DBI, but when i try to install OLE, in a similar way, it gives me an error.

    2)please do give me some information on the Database connectivity with perl using ole

    thanks...

  2. #2
    Join Date
    Jun 2004
    Location
    Nowhere Near You
    Posts
    89
    You're running ActiveState's Perl 5.6 or 5.8 so Win32-OLE is part of the core installation (as long as you're running windows!)

  3. #3
    Join Date
    Mar 2004
    Posts
    114

    2)

    I suggest to use DBI with DBD::ADO (due to portability, speed and lightweight). Sample:
    Code:
    use strict;
    use DBI;
    
    my $access = "C:\\Path\\to\\your\\file.mdb";
    # ADO connection
    my $dsn = "Driver={Microsoft Access driver (*.mdb)};dbq=$access";
    my $dbh = DBI->connect("dbi:ADO:$dsn")
            or die "Impossible connection: $DBI::errstr";
    
    # prepare query
    my $sth = $dbh->prepare("you query here")
            or die "Can't prepare statement: $DBI::errstr";
    # query execution
    my $rc = $sth->execute
            or die "Can't execute statement: $DBI::errstr";
    
    # Deconnexion
    $dbh->disconnect;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •