Re: DBD::ADO and ODBC Information Code

From: Steffen Goeldner (sgoeldner_at_cpan.org)
Date: 01/16/04


Date: Fri, 16 Jan 2004 10:52:07 +0100
To: "Peter Hir***" <peter@hir***.com>


Peter Hir*** wrote:

> Thanks, I had a feeling this was not a quick fix.
>
> The $dbh->errstr is all from the execute()

Umm, maybe I need a trace. But I know you are a courageous boy -
thus try this first, please:

  use Win32::OLE();

  my $cxn = Win32::OLE->new('ADODB.Connection');

  $cxn->Open('test'); # Your DSN string (w/o 'dbi:ADO:')

  my $rs = $cxn->Execute('select * from table1'); # Your SQL

  my $err = $cxn->Errors;
  print "Error cnt: $err->{Count}\n";
  print $_->Description, "\n" for Win32::OLE::in( $err );

  while ( !$rs->{EOF} ) {
    print $_->Value, ":" for Win32::OLE::in( $rs->Fields );
    print "\n";
    $rs->MoveNext;
  }
  $rs->Close;
  $cxn->Close;

Adjust the DSN and SQL strings accordingly!

Steffen