On Wed, Nov 28, 2001 at 05:10:54PM -0800, Alan Hogue wrote:

> I am really baffled by this behavior. Does anyone have any idea what's
> going on?
> 
> I have to get some data from a visual foxpro db. I'm using activestate
> perl 5.6.1 on Windows 2000. DBI 1.14, DBD::ODBC 0.28.
> 
> As far as I can tell, the code is perfectly ordinary and
> straightforward:
> 
> ___________________________________
> 
> open (OUT, ">lc_dbi_log") or die
>  "Can't open new file: $!\n";
> 
> DBI->trace( 2 );
> 
> my $dbh = DBI->connect(  'dbi:ODBC:LawCareers',
>        undef,
>        undef , {
        AutoCommit => 1,
        RaiseError => 1,
        PrintError => 1
>         } ) or die "Whoa!: " . $DBI::errstr;

Either Add the above lines or check the error status after each method
call.

> my $sth = $dbh->prepare( 'select emp_firm,emp_url
>        from employer,emp_vis
>        where (emp_id = vis_emp) and
>        vis_event IN ("P1", "P2") order by emp_firm');

What is the $dbh->err?

> $sth->execute();

Did the execute work correctly? ($sth->err or $sth->errstr)  From
looking at the trace message, the driver (ODBC) does not understand
the column type.  You may need to upgrade DBI and DBD::ODBC or the VF
ODBC driver.

> while (my @row = $sth->fetchrow_array()) {
>  print OUT "@row\n";
> }
> 

Tom


-- 
Thomas A. Lowery
See DBI/FAQ http://tlowery.hypermart.net

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to