Hello,
I've spent some time looking at the archives and couldn't find anything
that really addresses this. Sorry if I missed something.
I need to grab some data from a Visual Foxpro database sitting on a
remote disk. Here's my set up:
Windows 2000 5.00, SP2
Perl 5.6.1
DBI 1.20
DBD-ODBC 0.28
ODBC 3.52
MS Visual Foxpro Driver 6.01
When I run the code below, everything works fine until I try to fetch
the third row. At that point, Windows gives an error saying that Perl
has committed an access violation. I have verified everything else and
even the first few iterations of the fetch work. I can't figure out what
could cause this.
When I tried putting a trace on it (right before the fetch), it doesn't
include any more information, which makes me think that it's maybe a
problem with one of the ODBC components rather than the script...? Or
maybe I'm missing something?
I should also note that I can use the same DSN to run the same queries
from WinSQL without a problem.
Here's some of the code:
###########################
#Connections
my $lc = DBI->connect( 'dbi:ODBC:LC_System', undef, undef,
{ AutoCommit => 1,
RaiseError => 1,
PrintError => 1
} ) or die 'Can not connect to Law Careers:' . $DBI::errstr;
###########################
#Prepare statements to gather current data
my $oci_hast = $lc->prepare( 'SELECT emp_id, emp_firm,
emp_add1,
emp_add2,
emp_add3,
emp_city,
emp_state,
emp_zip,
emp_phone,
emp_email,
con_fname,
con_lname,
con_title,
con_phone,
con_email
FROM employer LEFT OUTER JOIN emp_cont
ON emp_id = con_emp
WHERE (emp_status LIKE "%F2%"
AND con_pcode = "PC"
AND con_id = 1)
AND (ue_fld1 = "Y" AND ue_fld2 != "Y")' )
or die 'Can not prepare hastings query: ' . $DBI::errstr;
########################
#Execute and bind output of current data.
my ( $emp_id_hast,
$emp_firm_hast,
$emp_add1_hast,
#etc...
$oci_hast->execute();
$oci_hast->bind_col( 1, \$emp_id_hast );
$oci_hast->bind_col( 2, \$emp_firm_hast );
$oci_hast->bind_col( 3, \$emp_add1_hast );
#etc...
while ( $oci_hast->fetch ) {
print $emp_id_hast, $emp_firm_hast;
}
If anyone has any idea what's going on, I'd really appreciate any help
or pointers.
Thanks,
Alan Hogue