Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[rt.cpan.org #65052] Cannot create ADODB.Connection object under Cygwin

42 views
Skip to first unread message

Rafael Kitover via RT

unread,
Jan 23, 2011, 4:40:46 PM1/23/11
to libw...@perl.org
Sun Jan 23 16:40:46 2011: Request 65052 was acted upon.
Transaction: Ticket created by RKITOVER
Queue: Win32-OLE
Subject: Cannot create ADODB.Connection object under Cygwin
Broken in: 0.1709
Severity: Important
Owner: Nobody
Requestors: rkit...@cpan.org
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65052 >


This is on 64bit Windows 7.

On Cygwin:

$ perl -Mblib -MData::Dumper -MWin32::OLE -le 'print Dumper(Win32::OLE-
>new("ADODB.Connection"))'
$VAR1 = undef;

On ActiveState Perl 32 bit:

$ perl -MData::Dumper -MWin32::OLE -le 'print Dumper(Win32::OLE->new
("ADODB.Connection"))'
$VAR1 = bless( {
'Properties' => bless( {
'Count' => 14,
'Item' => undef
}, 'Win32::OLE' ),
'ConnectionString' => 'Provider=MSDASQL.1',
'CommandTimeout' => 30,
'ConnectionTimeout' => 15,
'Version' => '6.1',
'Errors' => bless( {
'Count' => 0,
'Item' => undef
}, 'Win32::OLE' ),
'DefaultDatabase' => undef,
'IsolationLevel' => 4096,
'Attributes' => 0,
'CursorLocation' => 2,
'Mode' => 0,
'Provider' => 'MSDASQL.1',
'State' => 0
}, 'Win32::OLE' );

Reini Urban via RT

unread,
Jan 23, 2011, 4:48:06 PM1/23/11
to libw...@perl.org
Sun Jan 23 16:48:05 2011: Request 65052 was acted upon.
Transaction: Correspondence added by rur...@x-ray.at
Queue: Win32-OLE
Subject: Re: [rt.cpan.org #65052] Cannot create ADODB.Connection object under Cygwin

Broken in: 0.1709
Severity: Important
Owner: Nobody
Requestors: rkit...@cpan.org
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65052 >


2011/1/23 Rafael Kitover via RT <bug-Wi...@rt.cpan.org>:


> This is on 64bit Windows 7.
>
> On Cygwin:
>
> $ perl -Mblib -MData::Dumper -MWin32::OLE -le 'print Dumper(Win32::OLE-
>>new("ADODB.Connection"))'
> $VAR1 = undef;

On 32-bit Windows XP also.

All tests pass, but:


$ perl -Mblib -MData::Dumper -MWin32::OLE -le 'print
Dumper(Win32::OLE->new("ADODB.Connection"))'
$VAR1 = undef;

--
Reini Urban
http://phpwiki.org/           http://murbreak.at/

jand@ActiveState.com via RT

unread,
Jan 24, 2011, 1:59:40 PM1/24/11
to libw...@perl.org
Mon Jan 24 13:59:39 2011: Request 65052 was acted upon.
Transaction: Correspondence added by ja...@ActiveState.com
Queue: Win32-OLE
Subject: RE: [rt.cpan.org #65052] Cannot create ADODB.Connection object under Cygwin
Broken in: 0.1709
Severity: Important
Owner: Nobody
Requestors: rkit...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65052 >


> This is on 64bit Windows 7.
>
> On Cygwin:
>
> $ perl -Mblib -MData::Dumper -MWin32::OLE -le 'print Dumper(Win32::OLE-
> >new("ADODB.Connection"))'
> $VAR1 = undef;

Can you please run with warnings enabled? Win32::OLE will print
additional diagnostics on OLE calls when warnings are on.



> On ActiveState Perl 32 bit:

Is this just 32-bit ActivePerl on the same machine, or on a different
one?

Also, which Cygwin version are you using? Your example works fine
with my (obsolete) Cygwin 1.5 install.


Reini Urban via RT

unread,
Jan 24, 2011, 3:38:52 PM1/24/11
to libw...@perl.org
Mon Jan 24 15:38:51 2011: Request 65052 was acted upon.

Transaction: Correspondence added by rur...@x-ray.at
Queue: Win32-OLE
Subject: Re: [rt.cpan.org #65052] Cannot create ADODB.Connection object under Cygwin

Broken in: 0.1709
Severity: Important
Owner: Nobody
Requestors: rkit...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65052 >


>> This is on 64bit Windows 7.
>>
>> On Cygwin:
>>
>> $ perl -Mblib -MData::Dumper -MWin32::OLE -le 'print Dumper(Win32::OLE-
>> >new("ADODB.Connection"))'
>> $VAR1 = undef;
>
> Can you please run with warnings enabled?  Win32::OLE will print
> additional diagnostics on OLE calls when warnings are on.

$ perl -MWin32::OLE -wle 'print Win32::OLE->new("ADODB.Connection")'
Win32::OLE(0.1709) error 0x8007007e: "The specified module could not be
found" at -e line 1
eval {...} called at -e line 1
Use of uninitialized value in print at -e line 1.

With a debugging OLE lib and perl:

$ perl5.13.8d-nt -Mblib -we'use Win32::OLE;
Win32::OLE->new(q(ADODB.Connection))'
Win32::OLE(0.1709) error 0x8007007e: "The specified module could not be
found" at -e line 1
eval {...} called at -e line 1

$ gdb perl5.13.8d-nt
(gdb) run -Mblib -we'use Win32::OLE; print Win32::OLE->new(q(ADODB.Connection))'
Starting program: /usr/local/bin/perl5.13.8d-nt -Mblib -we'use
Win32::OLE; print Win32::OLE->new(q(ADODB.Connection))'
[New thread 8308.0xa88]
[New thread 8308.0xb10]
[New thread 8308.0x2380]
[New thread 8308.0x1ccc]
[New thread 8308.0xd8c]
[New thread 8308.0x22d8]
[New thread 8308.0x125c]
Win32::OLE=HASH(0xb56348)

This needs now printf debugging, oh my.

>> On ActiveState Perl 32 bit:
>
> Is this just 32-bit ActivePerl on the same machine, or on a different
> one?

I crosschecked with strawberry on the same machine, where
ADODB.Connection is registered.
c:\strawberry> perl -MData::Dumper -MWin32::OLE -le "print
Dumper(Win32::OLE->new(q(ADODB.Connection)))"


$VAR1 = bless( {
'Properties' => bless( {
'Count' => 14,
'Item' => undef
}, 'Win32::OLE' ),
'ConnectionString' => 'Provider=MSDASQL.1',
'CommandTimeout' => 30,
'ConnectionTimeout' => 15,
'Version' => '6.1',
'Errors' => bless( {
'Count' => 0,
'Item' => undef
}, 'Win32::OLE' ),
'DefaultDatabase' => undef,
'IsolationLevel' => 4096,
'Attributes' => 0,
'CursorLocation' => 2,
'Mode' => 0,
'Provider' => 'MSDASQL.1',
'State' => 0
}, 'Win32::OLE' );

> Also, which Cygwin version are you using?  Your example works fine


> with my (obsolete) Cygwin 1.5 install.

Latest 1.7.8 with my official perl

jand@ActiveState.com via RT

unread,
Jan 24, 2011, 3:59:12 PM1/24/11
to libw...@perl.org
Mon Jan 24 15:59:12 2011: Request 65052 was acted upon.

Transaction: Correspondence added by ja...@ActiveState.com
Queue: Win32-OLE
Subject: RE: [rt.cpan.org #65052] Cannot create ADODB.Connection object under Cygwin
Broken in: 0.1709
Severity: Important
Owner: Nobody
Requestors: rkit...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65052 >


On Mon, 24 Jan 2011, Reini Urban via RT wrote:
> > Can you please run with warnings enabled? Win32::OLE will print
> > additional diagnostics on OLE calls when warnings are on.
>

> $ perl -MWin32::OLE -wle 'print Win32::OLE->new("ADODB.Connection")'
> Win32::OLE(0.1709) error 0x8007007e: "The specified module could not be
> found" at -e line 1
> eval {...} called at -e line 1
> Use of uninitialized value in print at -e line 1.

[...]



> > Is this just 32-bit ActivePerl on the same machine, or on a different
> > one?
>

> I crosschecked with strawberry on the same machine, where
> ADODB.Connection is registered.
> c:\strawberry> perl -MData::Dumper -MWin32::OLE -le "print
> Dumper(Win32::OLE->new(q(ADODB.Connection)))"
> $VAR1 = bless( {
> 'Properties' => bless( {

[...]

Could you try running Cygwin Perl from cmd.exe instead of bash? I've
found several references with Google that certain COM components (WMI,
ADODB) cannot be instantiated when the program is started from bash,
but work fine when started from cmd.exe.

If that is the case, start looking into differences in those environments,
especially settings of PATH and maybe COMSPEC, and try to copy setting
from cmd.exe to bash until it starts working.

Cheers,
-Jan


rkitover@cpan.org via RT

unread,
Jan 24, 2011, 5:05:57 PM1/24/11
to libw...@perl.org
Mon Jan 24 17:05:57 2011: Request 65052 was acted upon.
Transaction: Correspondence added by rkit...@cpan.org
Queue: Win32-OLE
Subject: Re: [rt.cpan.org #65052] Cannot create ADODB.Connection object under Cygwin

Broken in: 0.1709
Severity: Important
Owner: Nobody
Requestors: rkit...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65052 >


On 1/24/2011 3:59 PM, ja...@ActiveState.com via RT wrote:
> <URL: https://rt.cpan.org/Ticket/Display.html?id=65052>
>
> On Mon, 24 Jan 2011, Reini Urban via RT wrote:

>>> Can you please run with warnings enabled? Win32::OLE will print
>>> additional diagnostics on OLE calls when warnings are on.
>>

>> $ perl -MWin32::OLE -wle 'print Win32::OLE->new("ADODB.Connection")'
>> Win32::OLE(0.1709) error 0x8007007e: "The specified module could not be
>> found" at -e line 1
>> eval {...} called at -e line 1
>> Use of uninitialized value in print at -e line 1.
>
> [...]
>

>>> Is this just 32-bit ActivePerl on the same machine, or on a different
>>> one?
>>

>> I crosschecked with strawberry on the same machine, where
>> ADODB.Connection is registered.
>> c:\strawberry> perl -MData::Dumper -MWin32::OLE -le "print
>> Dumper(Win32::OLE->new(q(ADODB.Connection)))"
>> $VAR1 = bless( {
>> 'Properties' => bless( {
>
> [...]
>
> Could you try running Cygwin Perl from cmd.exe instead of bash? I've
> found several references with Google that certain COM components (WMI,
> ADODB) cannot be instantiated when the program is started from bash,
> but work fine when started from cmd.exe.
>
> If that is the case, start looking into differences in those environments,
> especially settings of PATH and maybe COMSPEC, and try to copy setting
> from cmd.exe to bash until it starts working.
>
> Cheers,
> -Jan

That is indeed the case.

There are a whole bunch of warnings, but the object is returned:

c:\users\rkitover>\cygwin\bin\perl -MWin32::OLE -MData::Dumper -wle

"print Dumper(Win32::OLE->new('ADODB.Connection'))"

Win32::OLE(0.1709) error 0x8002000e: "Invalid number of parameters"
in METHOD/PROPERTYGET "Item" at
/usr/lib/perl5/5.10/i686-cygwin/Data/Dumper.pm line 190
Win32::OLE(0.1709) error 0x8002000e: "Invalid number of parameters"
in METHOD/PROPERTYGET "Item" at
/usr/lib/perl5/5.10/i686-cygwin/Data/Dumper.pm line 190
OLE exception from "ADODB.Connection":

Operation is not allowed when the object is closed.

Win32::OLE(0.1709) error 0x80020009: "Exception occurred"
in METHOD/PROPERTYGET "DefaultDatabase" at
/usr/lib/perl5/5.10/i686-cygwin/Data/Dumper.pm line 190


$VAR1 = bless( {
'Properties' => bless( {

jand@ActiveState.com via RT

unread,
Jan 24, 2011, 6:18:30 PM1/24/11
to libw...@perl.org
Mon Jan 24 18:18:29 2011: Request 65052 was acted upon.

Transaction: Correspondence added by ja...@ActiveState.com
Queue: Win32-OLE
Subject: RE: [rt.cpan.org #65052] Cannot create ADODB.Connection object under Cygwin
Broken in: 0.1709
Severity: Important
Owner: Nobody
Requestors: rkit...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65052 >


On Mon, 24 Jan 2011, rkit...@cpan.org via RT wrote:
> On 1/24/2011 3:59 PM, ja...@ActiveState.com via RT wrote:
> > Could you try running Cygwin Perl from cmd.exe instead of bash? I've
> > found several references with Google that certain COM components (WMI,
> > ADODB) cannot be instantiated when the program is started from bash,
> > but work fine when started from cmd.exe.

[...]

> That is indeed the case.
>
> There are a whole bunch of warnings, but the object is returned:

Those warnings are normal. Dumping the whole connection object will
try to fetch several properties that aren't initialized in the closed
state of the object. You get the same warnings with regular Perl.

I'm going to close this bug, as it seems to be neither an issue with
Perl nor with Win32::OLE but just with the way the Cygwin bash shell
sets up the environment, and therefore should be fixed there.

Cheers,
-Jan


Reini Urban

unread,
Jan 23, 2011, 4:47:56 PM1/23/11
to bug-Wi...@rt.cpan.org, libw...@perl.org
2011/1/23 Rafael Kitover via RT <bug-Wi...@rt.cpan.org>:
> This is on 64bit Windows 7.
>
> On Cygwin:
>
> $ perl -Mblib -MData::Dumper -MWin32::OLE -le 'print Dumper(Win32::OLE-
>>new("ADODB.Connection"))'
> $VAR1 = undef;

On 32-bit Windows XP also.

All tests pass, but:


$ perl -Mblib -MData::Dumper -MWin32::OLE -le 'print
Dumper(Win32::OLE->new("ADODB.Connection"))'
$VAR1 = undef;

--

Reini Urban

unread,
Jan 24, 2011, 3:38:40 PM1/24/11
to bug-Wi...@rt.cpan.org, libw...@perl.org
>> This is on 64bit Windows 7.
>>
>> On Cygwin:
>>
>> $ perl -Mblib -MData::Dumper -MWin32::OLE -le 'print Dumper(Win32::OLE-
>> >new("ADODB.Connection"))'
>> $VAR1 = undef;
>
> Can you please run with warnings enabled?  Win32::OLE will print
> additional diagnostics on OLE calls when warnings are on.

$ perl -MWin32::OLE -wle 'print Win32::OLE->new("ADODB.Connection")'


Win32::OLE(0.1709) error 0x8007007e: "The specified module could not be
found" at -e line 1
eval {...} called at -e line 1
Use of uninitialized value in print at -e line 1.

With a debugging OLE lib and perl:

$ perl5.13.8d-nt -Mblib -we'use Win32::OLE;
Win32::OLE->new(q(ADODB.Connection))'

Win32::OLE(0.1709) error 0x8007007e: "The specified module could not be
found" at -e line 1
eval {...} called at -e line 1

$ gdb perl5.13.8d-nt


(gdb) run -Mblib -we'use Win32::OLE; print Win32::OLE->new(q(ADODB.Connection))'
Starting program: /usr/local/bin/perl5.13.8d-nt -Mblib -we'use
Win32::OLE; print Win32::OLE->new(q(ADODB.Connection))'
[New thread 8308.0xa88]
[New thread 8308.0xb10]
[New thread 8308.0x2380]
[New thread 8308.0x1ccc]
[New thread 8308.0xd8c]
[New thread 8308.0x22d8]
[New thread 8308.0x125c]
Win32::OLE=HASH(0xb56348)

This needs now printf debugging, oh my.

>> On ActiveState Perl 32 bit:


>
> Is this just 32-bit ActivePerl on the same machine, or on a different
> one?

I crosschecked with strawberry on the same machine, where


ADODB.Connection is registered.
c:\strawberry> perl -MData::Dumper -MWin32::OLE -le "print
Dumper(Win32::OLE->new(q(ADODB.Connection)))"
$VAR1 = bless( {
'Properties' => bless( {

'Count' => 14,
'Item' => undef
}, 'Win32::OLE' ),
'ConnectionString' => 'Provider=MSDASQL.1',
'CommandTimeout' => 30,
'ConnectionTimeout' => 15,
'Version' => '6.1',
'Errors' => bless( {
'Count' => 0,
'Item' => undef
}, 'Win32::OLE' ),
'DefaultDatabase' => undef,
'IsolationLevel' => 4096,
'Attributes' => 0,
'CursorLocation' => 2,
'Mode' => 0,
'Provider' => 'MSDASQL.1',
'State' => 0
}, 'Win32::OLE' );

> Also, which Cygwin version are you using?  Your example works fine


> with my (obsolete) Cygwin 1.5 install.

Latest 1.7.8 with my official perl

Reini Urban via RT

unread,
Feb 8, 2012, 12:57:00 PM2/8/12
to libw...@perl.org
Wed Feb 08 12:56:59 2012: Request 65052 was acted upon.
Transaction: Correspondence added by RURBAN
Queue: Win32-OLE
Subject: Cannot create ADODB.Connection object under Cygwin
Broken in: 0.1709
Severity: Important
Owner: Nobody
Requestors: 0
Status: resolved
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65052 >


Second patch attached, for the preferred version to copy the whole ENV
when someones requests use Win32.
We don't want the full ENV in pure cygwin, only on use Win32.

--
Reini Urban

0001-initialize-cygwin-on-use-Win32-with-full-ENV-for-ADO.patch
0 new messages