Skip Menu |

This queue is for tickets about the DBD-ODBC CPAN distribution.

Report information
The Basics
Id: 111666
Status: resolved
Priority: 0/
Queue: DBD-ODBC

People
Owner: Nobody in particular
Requestors: mts [...] ansto.gov.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: DBI - Access OBDC bug [SEC=UNCLASSIFIED]
Date: Tue, 2 Feb 2016 06:30:42 +0000
To: "bug-DBD-ODBC [...] rt.cpan.org" <bug-DBD-ODBC [...] rt.cpan.org>
From: "SALE, Matthew" <mts [...] ansto.gov.au>
Good Day I have been doing some work with DBI/OBDC/ACCESS 2010 Unfortunately, some of the time when I ask for my data it ends up corrupted. For example, the following code produces corruption... #!perl use strict; use warnings; use DBI; use Data::Dumper; my $dbh = DBI->connect('dbi:ODBC:Test'); my $sqlstatementExisting = " SELECT * FROM Table1 "; my $sth = $dbh->prepare($sqlstatementExisting); $sth->execute # ([$name]) || die "Could not execute SQL statement ... maybe invalid? ".$dbh->errstr; while (my @row = $sth->fetchrow_array) { print Dumper (@row); } This produces the following result... $VAR1 = 1; $VAR2 = 'E-6'; However, the data stored in the database is as follows... Table1 ID Field1 1 8.93601020357839E-06 For some reason, my data is being truncated to just the exponent values and text. I am unsure how to fix this as it appears to be a bug in either the perl modules or hopefully not in the OBDC or ACCESS part of the code. Matt
On Tue Feb 02 01:31:26 2016, mts@ansto.gov.au wrote: Show quoted text
> Good Day > > I have been doing some work with DBI/OBDC/ACCESS 2010 > Unfortunately, some of the time when I ask for my data it ends up > corrupted. > > For example, the following code produces corruption... > > #!perl > use strict; > use warnings; > use DBI; > use Data::Dumper; > > my $dbh = DBI->connect('dbi:ODBC:Test'); > > my $sqlstatementExisting = " > SELECT * > FROM Table1 > "; > > my $sth = $dbh->prepare($sqlstatementExisting); > $sth->execute # ([$name]) > || die "Could not execute SQL statement ... > maybe invalid? ".$dbh->errstr; > > while (my @row = $sth->fetchrow_array) { > print Dumper (@row); > } > > > This produces the following result... > $VAR1 = 1; > $VAR2 = 'E-6'; > > However, the data stored in the database is as follows... > Table1 > > ID > > Field1 > > 1 > > 8.93601020357839E-06 > > > > For some reason, my data is being truncated to just the exponent > values and text. > I am unsure how to fix this as it appears to be a bug in either the > perl modules or hopefully not in the OBDC or ACCESS part of the code. > > > Matt
Hi Matt, What versions of Perl, DBI and DBD::ODBC are you using? What is the access column type for Field1? I'm presuming you are running on Windows? Could you do this: set DBI_TRACE=15=x.log perl myprogram.pl then send me what is in x.log. Martin -- Martin J. Evans Wetherby, UK
Subject: RE: [rt.cpan.org #111666] DBI - Access OBDC bug [SEC=UNCLASSIFIED]
Date: Wed, 3 Feb 2016 01:03:36 +0000
To: "bug-DBD-ODBC [...] rt.cpan.org" <bug-DBD-ODBC [...] rt.cpan.org>
From: "SALE, Matthew" <mts [...] ansto.gov.au>

Message body is not shown because it is too large.

On Tue Feb 02 20:03:56 2016, mts@ansto.gov.au wrote: Show quoted text
> Good Day Martin > > I am currently running > Strawberry perl 32-bit v5.22.1 > DBI 1.634 > DBD::ODBC 1.52 > Windows 7 > Access 2010 > > The content of the data base is ... > ID(LongInteger) Field1(Double) > 1 8.93601020357839E-06 > 2 0.0000000086 > > The result of running the code is... > $VAR1 = 1; > $VAR2 = 'E-6'; > $VAR1 = 2; > $VAR2 = '0.0000000086'; > > -> it appears that something doesn't like scientific notation but > things are OK if there aren't too many significant figures. > > The result of x.log is as follows... >
<snipped> Thanks for all the info. I have something to look at here. Give me until end of tomorrow and if you haven't heard anything from me nag me to remind me. Martin -- Martin J. Evans Wetherby, UK
On Wed Feb 03 04:43:15 2016, MJEVANS wrote: Show quoted text
> On Tue Feb 02 20:03:56 2016, mts@ansto.gov.au wrote:
> > Good Day Martin > > > > I am currently running > > Strawberry perl 32-bit v5.22.1 > > DBI 1.634 > > DBD::ODBC 1.52 > > Windows 7 > > Access 2010 > > > > The content of the data base is ... > > ID(LongInteger) Field1(Double) > > 1 8.93601020357839E-06 > > 2 0.0000000086 > > > > The result of running the code is... > > $VAR1 = 1; > > $VAR2 = 'E-6'; > > $VAR1 = 2; > > $VAR2 = '0.0000000086'; > > > > -> it appears that something doesn't like scientific notation but > > things are OK if there aren't too many significant figures. > > > > The result of x.log is as follows... > >
> > <snipped> > > Thanks for all the info. I have something to look at here. Give me > until end of tomorrow and if you haven't heard anything from me nag me > to remind me. > > Martin
Hi Matt, The good news is I have the fix for you. The bad news (maybe) is you'll need to download a new MS Access ODBC Driver. I'm guessing you are using the MS Access 2010 driver (v14 - look in your ODBC driver manager under the driver tab for the accdb driver) or earlier. This driver is broken (and earlier) are broken. I have verified this using MS's odbctest application. The newer 2013 (v15) driver appears to work. Search for "MS Access 2013 redistributable engine" and install the appropriate version for your OS. I have verified this fixes the problem for me here. Martin -- Martin J. Evans Wetherby, UK
Subject: RE: [rt.cpan.org #111666] DBI - Access OBDC bug [SEC=UNCLASSIFIED]
Date: Thu, 4 Feb 2016 01:33:00 +0000
To: "bug-DBD-ODBC [...] rt.cpan.org" <bug-DBD-ODBC [...] rt.cpan.org>
From: "SALE, Matthew" <mts [...] ansto.gov.au>
Good Day Martin I have updated to the "MS Access 2013 redistributable engine" and after re-configuring my ODBC connections, the database access appears to be working now. Thanks for your speedy help, Matt Show quoted text
-----Original Message----- From: Martin J Evans via RT [mailto:bug-DBD-ODBC@rt.cpan.org] Sent: Thursday, 4 February 2016 1:43 AM To: SALE, Matthew Subject: [rt.cpan.org #111666] DBI - Access OBDC bug [SEC=UNCLASSIFIED] <URL: https://rt.cpan.org/Ticket/Display.html?id=111666 > On Wed Feb 03 04:43:15 2016, MJEVANS wrote:
> On Tue Feb 02 20:03:56 2016, mts@ansto.gov.au wrote:
> > Good Day Martin > > > > I am currently running > > Strawberry perl 32-bit v5.22.1 > > DBI 1.634 > > DBD::ODBC 1.52 > > Windows 7 > > Access 2010 > > > > The content of the data base is ... > > ID(LongInteger) Field1(Double) > > 1 8.93601020357839E-06 > > 2 0.0000000086 > > > > The result of running the code is... > > $VAR1 = 1; > > $VAR2 = 'E-6'; > > $VAR1 = 2; > > $VAR2 = '0.0000000086'; > > > > -> it appears that something doesn't like scientific notation but > > things are OK if there aren't too many significant figures. > > > > The result of x.log is as follows... > >
> > <snipped> > > Thanks for all the info. I have something to look at here. Give me > until end of tomorrow and if you haven't heard anything from me nag me > to remind me. > > Martin
Hi Matt, The good news is I have the fix for you. The bad news (maybe) is you'll need to download a new MS Access ODBC Driver. I'm guessing you are using the MS Access 2010 driver (v14 - look in your ODBC driver manager under the driver tab for the accdb driver) or earlier. This driver is broken (and earlier) are broken. I have verified this using MS's odbctest application. The newer 2013 (v15) driver appears to work. Search for "MS Access 2013 redistributable engine" and install the appropriate version for your OS. I have verified this fixes the problem for me here. Martin -- Martin J. Evans Wetherby, UK