Click here to get back home

Perl DBI ODBC

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Perl DBI ODBC Bernd Sandmann 10-12-2005
  |--> Re: Perl DBI ODBC Bernd Sandmann10-13-2005
  `--> Re: Perl DBI ODBC Bernd Sandmann10-13-2005
Get Chitika Premium
Posted by Bernd Sandmann on October 12, 2005, 5:12 pm
Please log in for more thread options


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.

use DBI;

$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?


Posted by John Bokma on October 12, 2005, 4:17 pm
Please log in for more thread options



> 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?)

> use DBI;

A lot of people will complain if you don't use strict and use warnings;

> $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.

--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
I ploink googlegroups.com :-)



Posted by Bernd Sandmann on October 13, 2005, 9:16 am
Please log in for more thread options


John Bokma schrieb:
>
>
>>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.




Posted by Bernd Sandmann on October 13, 2005, 9:18 am
Please log in for more thread options


John Bokma schrieb:
>
>
>>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.




Similar ThreadsPosted
perl DBI,DBD::ODBC installation help March 7, 2006, 12:42 am
XP, Perl, Win32::ODBC, Microsoft Access 2002 SP3, & Chinese characters January 22, 2008, 4:18 pm
win32::odbc October 3, 2005, 2:04 pm
Can't locate DBD/ODBC.pm in @INC November 20, 2008, 11:55 am
Where to ask questions about Win32::ODBC? July 14, 2004, 9:36 am
SQL Server triggers (dbi:ODBC vs dbi:Sybase) August 12, 2004, 9:15 am
Probelm with Unicode and ODBC-Drivers March 8, 2005, 12:07 pm
Catalog() in Win32::ODBC for MySQL August 27, 2006, 1:58 am
Alternate option to win32::ODBC July 19, 2007, 2:44 pm
Alternate option to win32::ODBC July 19, 2007, 3:17 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap