[unixODBC-support] truncated memo fields

Martin J. Evans martin.evans at easysoft.com
Wed Nov 16 20:17:34 GMT 2005


tom wright wrote:
> Matin,
> Heres the odbc_bridgec.?? file, I guess this shows the data is getting truncated.

Yes, it appears so.

> I shall look into increasing the buffer size since I think this may be the problem. 

What you need to consider is how long the column data is in bytes and 
then how the column data is being retrieved. e.g. retrieving some binary 
column types as char will cause the driver to return hex chrs which is
obviously longer e.g. char(255) can be returned as 0xff, 4 * increase.

> However please let me know if you have any other ideas.

Can you run a select length(column5) from table (or whatever syntax
MS Access supports) to find the true length of a column. This will tell
you how much data there really is in the column.

The only other way is to write a small bit of C which binds the column
then look at the StrLen_or_IndPtr returned by SQLBindCol - but that
could be SQL_NO_TOTAL in which case that would not help either.

The actual problem is probably the buffer passed to SQLBindCol
not being large enough which suggests the column is longer than 64K
(in retrieved and possibly converted data).

BTW, if you are not using at least JET 4 pay heed to that warning in
the SQLDriverConnect call about running OOB in multi-threaded mode as
JET before 4 is NOT thread-safe.

FYI those "Column=14475272" are down to Access ODBC driver not setting
the column in error in the diagnostic record. With other drivers it
would show column 5.

Martin


>>Do you have a /tmp/odbc_bridgec.??? file as well you can send me?
>>
>>The 5th column is (Column:5 Name:Data Type:-1 Size:2147483647 DD:0 N:1)
>>but the SQLFetch is returning SQL_SUCCESS_WITH_INFO which may indicate
>>a data truncated. The buffer OOB is using is what the app provided
>>which was 65535 bytes.
>>
>>Martin
>>
>>--
>>Martin J. Evans
>>Easysoft Ltd, UK
>>Development
>>
>>
>>------------------------------------------------------------------------
>>
>>sqlstate=01000 native=0 "[Easysoft ODBC (Server)]Warning: You are running OOB Server Multi-threaded to the MS Access ODBC driver which is not thread-safe. Switch OOB Server to MultiProcess" Column=0
>>sqlstate=01004 native=5 "[][Microsoft][ODBC Microsoft Access Driver]String data, right truncated on column number 5 (Data)" Column=14475272
>>sqlstate=01004 native=5 "[][Microsoft][ODBC Microsoft Access Driver]String data, right truncated on column number 5 (Data)" Column=14475272
>>sqlstate=01004 native=5 "[][Microsoft][ODBC Microsoft Access Driver]String data, right truncated on column number 5 (Data)" Column=14475272
>>sqlstate=01000 native=0 "[Easysoft ODBC (Server)]Warning: You are running OOB Server Multi-threaded to the MS Access ODBC driver which is not thread-safe. Switch OOB Server to MultiProcess" Column=0
>>sqlstate=01004 native=5 "[][Microsoft][ODBC Microsoft Access Driver]String data, right truncated on column number 5 (Data)" Column=14475272




More information about the unixODBC-support mailing list