www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/06/19/11:03:43

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT
X-Spam-Check-By: sourceware.org
X-RAL-MFrom: <T DOT J DOT Adye AT rl DOT ac DOT uk>
X-RAL-Connect: <hepntw321.pp.rl.ac.uk [130.246.41.185]>
From: "Tim Adye" <T DOT J DOT Adye AT rl DOT ac DOT uk>
To: <cygwin AT cygwin DOT com>
Subject: Perl Win32::OLE ADODB.Connection fails on Vista
Date: Fri, 19 Jun 2009 16:02:22 +0100
Message-ID: <000401c9f0ef$01e2f1b0$05a8d510$@J.Adye@rl.ac.uk>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi,

I have been using the Cygwin Perl Win32::OLE module as a nice way to query
Access databases [*]. This worked fine on Windows XP (32-bit), but no longer
works on a new Vista (64-bit) machine. The initial connection

  $conn= Win32::OLE->new ('ADODB.Connection')

fails with

  Win32::OLE(0.1709) error 0x8007007e: "The specified module could not be
found"

Connecting to some other OLE applications (eg. Excel.Application) works OK.
The same ADODB script works fine from ActiveState Perl (at least for the
32-bit version; there is no 64-bit version of the Microsoft Access Driver,
so ActiveState Perl x64 fails at the next step). However I'd prefer to use
Cygwin Perl.

I upgraded Cygwin's Win32::OLE to the latest version (perl-5.10.0-5 comes
with Win32::OLE 0.1703, while the latest ActiveState Perl has Win32::OLE
0.1709), but that didn't help.

Does anyone have any ideas?

Thanks,
Tim.

[*] eg. the following will read all values from $field in $table of $file
(this example can be modified with an arbitrary SQL query).

  use Win32::OLE;
  Win32::OLE->Option (Warn => 3);
  my $conn= Win32::OLE->new ('ADODB.Connection') or die;
  $conn->Open ("PROVIDER=MSDASQL;".
               "DRIVER={Microsoft Access Driver (*.mdb)};".
               "DBQ=$file");
  my $rs= Win32::OLE->new ('ADODB.Recordset') or die;
  $rs->Open ("SELECT $field FROM $table", $conn, 1, 1);
  until ($rs->EOF) {
    print $rs->Fields ($field)->value, "\n";
    $rs->MoveNext;
  }
  $rs->Close;
  $conn->Close;

===========================  cut here  ============================
 Tim Adye      T DOT J DOT Adye AT rl DOT ac DOT uk       http://hepunx.rl.ac.uk/~adye
 Atlas/BaBar Groups, Particle Physics Dept, Rutherford Appleton Lab



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019