in reply to OLE exception from ADODB.Connection
My guess is that your "closed" connection was never opened in the first place. The lines below to open the connection (excerpted from your code) have no error checking before or after them to make sure the connection is valid. If the connection can't be created, your program continues merrily as if everything was OK. You could be miles away from the original code that created the connection before you ever see problems.
my $conn = Win32::OLE->CreateObject('ADODB.Connection'); # Open a connection using the SQL Server OLE DB Provider LogIt( $fhDEBUG, "Opening ADODB connection") if $CONFIG{DEBUG} > 3; $conn->Open(<<EOF); $DSN EOF
Logging isn't enough. It only reports problems, it doesn't change the program flow to account for them.
Might be a good idea to add some error checking code and throw an exception or at least return undef immediately after the connection creation code when the connection fails.
Best, beth
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: OLE exception from ADODB.Connection
by Mych (Initiate) on Apr 07, 2009 at 09:37 UTC | |
by Mych (Initiate) on Apr 07, 2009 at 13:14 UTC |