DBD:ODBC and memo fields 
Author Message
 DBD:ODBC and memo fields

When using the DBD:ODBC connection to a MS Access database, I sometimes get
errors when accessing MEMO fields.  The specific error is:

DBD::ODBC::st fetchrow_array failed: [Microsoft][ODBC Microsoft Access
Driver]String data, right truncated on column number 6 (AuditInfo)
(SQL-01004)(DBD: st_fetch/SQLFetch (long truncated) err=1) at
C:\Perl\development\odbc_connectdirect.pl line 25.
DBI::db=HASH(0x1cd0fcc)->disconnect invalidates 1 active statement handle
(either destroy statement handles or call finish on them before
disconnecting) at C:\Perl\development\odbc_connectdirect.pl line 46.

Is there a way to correct retreive MEMO field information?

Thanks.



Sat, 21 Aug 2004 00:28:50 GMT  
 DBD:ODBC and memo fields

Quote:

> When using the DBD:ODBC connection to a MS Access database, I sometimes get
> errors when accessing MEMO fields.  [...]
> Is there a way to correct retreive MEMO field information?

Yes. Read the documentation for DBD::ODBC, "How do I read more than N
characters from a MEMO [...] field?"

Chris



Sat, 21 Aug 2004 01:09:33 GMT  
 DBD:ODBC and memo fields

I believe that DBI has a lmit the the number of bytes it can retrive.  You
need to override this.  After you do your DBI->connect(), try
  $dbh->{LongReadLen} = 8192  #set this the number of bytes you want as your
upper limit
  $dbh->{LongTruncOk} = 1;

Then go ahead with your queries.  If I understand your problem correctly,
that should solve your problem.


Quote:
> When using the DBD:ODBC connection to a MS Access database, I sometimes
get
> errors when accessing MEMO fields.  The specific error is:

> DBD::ODBC::st fetchrow_array failed: [Microsoft][ODBC Microsoft Access
> Driver]String data, right truncated on column number 6 (AuditInfo)
> (SQL-01004)(DBD: st_fetch/SQLFetch (long truncated) err=1) at
> C:\Perl\development\odbc_connectdirect.pl line 25.
> DBI::db=HASH(0x1cd0fcc)->disconnect invalidates 1 active statement handle
> (either destroy statement handles or call finish on them before
> disconnecting) at C:\Perl\development\odbc_connectdirect.pl line 46.

> Is there a way to correct retreive MEMO field information?

> Thanks.



Sat, 21 Aug 2004 17:53:40 GMT  
 DBD:ODBC and memo fields
Quote:

> When using the DBD:ODBC connection to a MS Access database, I
> sometimes get errors when accessing MEMO fields.
> The specific error is:

> DBD::ODBC::st fetchrow_array failed: [Microsoft][ODBC Microsoft Access
> Driver]String data, right truncated on column number 6 (AuditInfo)
> (SQL-01004)(DBD: st_fetch/SQLFetch (long truncated) err=1) at
> C:\Perl\development\odbc_connectdirect.pl line 25.

[this second message snipped and moved below...]

Quote:

> Is there a way to correct retreive MEMO field information?

Yes:

while(1) {



       $dbh->{LongReadLen} *= 2;


Quote:
}

[This is of course with RaiseError on.]

The reason you get the other message:

Quote:
> DBI::db=HASH(0x1cd0fcc)->disconnect invalidates 1 active statement
> handle (either destroy statement handles or call finish on them before
> disconnecting) at C:\Perl\development\odbc_connectdirect.pl line 46.

Is because even though an error was thrown [the truncation error], that
statement handle was NOT invalidated, and was still active when the perl
script exited...  And when perl exited, the database handle was
DESTROY()ed, which disconnected it.  And with ODBC, if the database is
disconnected while statement handles are still active, the driver
assumes that you made an error, and prints this message.

--
print reverse( ",rekcah", " lreP", " rehtona", " tsuJ" )."\n";



Mon, 23 Aug 2004 16:11:15 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. DBD::ODBC DBI and MS Access memo field

2. DBD::ODBC DBI and Microsoft Access memo field

3. DBD/DBI ODBC and Microsoft Access 97 memo field

4. DBD::ODBC truncates Memo type Access field

5. ODBC and Access memo fields

6. DBD::ODBC and date/time field overflow

7. DBD::ODBC and date/time fields

8. DBD::ODBC MS-Access "MEMO" fields?

9. Perl DBD ODBC 0.20; MS Access; Memo fields

10. Using xbase.pm to slurp up images fronm a memo field

11. Perl DBI won't return Access Memo fields

12. DBI select with memo fields

 

 
Powered by phpBB® Forum Software