in reply to OLE exception from ADODB.Connection
and it fails for CSS DB right? You never check if $conn->Open($DSN); succeeded, so when it fails for CSS DB, you try to Execute , but you can't because it failed( probably account permissions). See http://www.xav.com/perl/Windows/windows_script_components.htmlLogIt( $fhDEBUG, "Opening ADODB connection") if $CONFIG{DEBUG} > 3; $conn->Open(<<EOF); $DSN EOF LogIt( $fhDEBUG, "COMPLETE: Opening ADODB connection") if $CONFIG{D +EBUG} > 3; # my $sql =<<SQL; SELECT $cols FROM $table WHERE $criteria SQL map { LogIt( $fhDEBUG, $_ )} split /\n/, $sql if $CONFIG{DEBUG} > +3; my $rs = $conn->Execute($sql); LogIt( $fhDEBUG, "COMPLETE: executing SQL") if $CONFIG{DEBUG} > 3; if( !defined( $rs ) ){ LogIt( $fhDEBUG,"something went wrong: ", Win32::OLE->LastError( +)); LogIt( $fhERROR, "something went wrong: ", Win32::OLE->LastError +()); die "<lookup> died something went wrong: ", Win32::OLE->LastErro +r(),"\n"; }
if($conn->{State} == adStateOpen) { $status = "Connection was a success"; } else { $status = "Connection failed because "; $status .= $conn->Errors(0)->{Description}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: OLE exception from ADODB.Connection
by Anonymous Monk on Apr 06, 2009 at 14:04 UTC |