in reply to Re: OLE exception from ADODB.Connection
in thread OLE exception from ADODB.Connection

Thanks Beth and Annon,

I've ammended the code to log the conn status, as recommended by both of you, to see if I am making a connection. (BTW I tested the connection using the 'Test connection' at the end of the ODBC wizzard and that's fine.

The ammedments are...

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 # Added 07/04/09 on recomendation (Perl Monks) a check to see if DB + connection was really successfull. my $connStatus ="Not Set" if($conn->{State} == adStateOpen) { $connStatus = "Connection was a success"; } else { $connStatus = "Connection failed because "; $connStatus .= $conn->Errors(0)->{Description}; } #LogIt( $fhDEBUG, "COMPLETE: Opening ADODB connection") if $CONFIG{ +DEBUG} > 3; #changed above line to log status of connection LogIt( $fhDEBUG, $connStatus) if $CONFIG{DEBUG} > 3; # End of 07/04/09 changes

I also commented out all the extra sql lookups so that I was only making one lookup per DB... unfortunately the error now is...

CGI Timeout The specified CGI application exceeded the allowed time for processing +. The server has deleted the process.

Nothing is logged to the DEBUG file at all

I'll try some more experimenting... meanwhile if someone can spot something I've obviously missed out...let me know.

Mych
I have not failed... just found 100 ways that don't work YET!

Replies are listed 'Best First'.
Re^3: OLE exception from ADODB.Connection
by Mych (Initiate) on Apr 07, 2009 at 13:14 UTC

    All, Thanks

    As you all rightly pointed out. I was not logging useful info in my debug file. The problem was a permissions issue to the DB. All DB's apart from CSSD had dbreader rights assigned to the IIS_User. My Bad.

    Mych
    I have not failed... just found 100 ways that don't work YET!