Re: Perl DBI ODBC
- From: Bernd Sandmann <b.sandmann@xxxxxxx>
- Date: Thu, 13 Oct 2005 09:18:16 +0200
John Bokma schrieb: > Bernd Sandmann <b.sandmann@xxxxxxx> wrote: > > >>Hello, >> >>the following Script is crashing under Windows with the Error: >> >>--------------------------- >>perl.exe - Fehler in Anwendung >>--------------------------- >>Die Anweisung in "0x1134030c" verweist auf Speicher in "0x1134030c". >>Der Vorgang "read" konnte nicht auf dem Speicher durchgeführt werden. >>Klicken Sie auf "OK", um das Programm zu beenden. > > > Which version of DBI, ODBC, Perl (ActiveState? Other?) The Versions are: Perl ActiveState Version 5.8.7 Build 813 DBI 1.48 DBD-ODBC 1.13
i think these are the newest versions. But i have also tested it with different versions of Perl and DBI,ODBC. The error is always the same.
>
>
>>use DBI;
>
>
> A lot of people will complain if you don't use strict and use warnings;
You are right, i haven´t used it because of my decleration errors :-)
The finally script is much longer, so i use this little part only for the testing of the ODBC-Access.
>
>
>>$SQL = "select * from PeriodenumsaetzeSachkonten";
>>
>>my $DSN = "Sage KHK 3.3.3";
>>my $dbh = DBI->connect("dbi:ODBC:$DSN", '','')
>> or die "$DBI::errstr\n";
>>
>>$sth = $dbh->prepare($SQL);
>>$sth->execute() or die "$DBI::errstr\n";
>>
>>$sth->dump_results;
>>
>>$dbh->disconnect;
>>
>>Can someone help me?
>
>
> Try to comment out each line, then turn them on one by one, to find the
> crash point.
>
The error comes after the execution of the prepare Statement.
( $sth = $dbh->prepare($SQL);)
A trace show the folloing:
perl -w test.pl
DBI 1.48-ithread default trace level set to 0x0/1 (pid 1664)
-> DBI->connect(dbi:ODBC:Sage KHK 3.3.3, , ****)
-> DBI->install_driver(ODBC) for MSWin32 perl=5.008007 pid=1664 ruid=0 euid=
0
install_driver: DBD::ODBC version 1.13 loaded from C:/Programme/Perl/site
/lib/DBD/ODBC.pm
<- install_driver= DBI::dr=HASH(0x1b6236c)
<- connect('Sage KHK 3.3.3' '' ...)= DBI::db=HASH(0x1bdf1c4) at DBI.pm line
598
<- STORE('PrintError' 1)= 1 at DBI.pm line 645
<- STORE('AutoCommit' 1)= 1 at DBI.pm line 645
<- STORE('Username' '')= 1 at DBI.pm line 648
<> FETCH('Username')= '' ('Username' from cache) at DBI.pm line 648
<- connect= DBI::db=HASH(0x1bdf1c4)
<- STORE('dbi_connect_closure' CODE(0x1bdf104))= 1 at DBI.pm line 668
<- prepare('select Kontonummer from PeriodenumsaetzeSachkonten')= DBI::st=HA
SH(0x1be8730) at test.pl line 21
<- DESTROY(DBI::st=HASH(1be8730))= undef
<- DESTROY(DBI::db=HASH(1bdf1c4))= undef
<- disconnect_all= '' at DBI.pm line 677
! <- DESTROY(DBI::dr=HASH(1b6236c))= undef during global destruction
The Script crashes always when it is ended. As soon as the Destroy statements where executed.
Regards Bernd.
.
- References:
- Perl DBI ODBC
- From: Bernd Sandmann
- Re: Perl DBI ODBC
- From: John Bokma
- Perl DBI ODBC
- Prev by Date: Re: Perl DBI ODBC
- Next by Date: Perl Class::Struct
- Previous by thread: Re: Perl DBI ODBC
- Next by thread: Perl Class::Struct
- Index(es):
Relevant Pages
|
|