Bug #47800 LONGTEXT data is truncated when retrieved using DAO ODBCDirect
Submitted: 2 Oct 2009 16:54 Modified: 7 Oct 2010 8:53
Reporter: Hal Lind Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.1.5 OS:Microsoft Windows
Assigned to: Bogdan Degtyariov CPU Architecture:Any
Tags: DAO ODBCDirect

[2 Oct 2009 16:54] Hal Lind
Description:
LONGTEXT data will be truncated to the actual length of data contained in the LONGTEXT field of the LAST record of a DAO recordset created using ODBCDirect.

EG:

Record 1 LONGTEXT = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Record 2 LONGTEXT = "1234"

Create a recordset using DAO ODBCDirect so that record 2 is the last record.

Data in record 1 will be truncated to "ABCD" (the length of "1234")

NOTE: {MySQL ODBC 3.51 Driver} works properly. Only 5.1.5 driver exhibits this behavior.

How to repeat:
See attached .vbs example
[2 Oct 2009 16:55] Hal Lind
LONGTEXT Truncated

Attachment: dao_longtext_field_truncated.vbs (, text), 2.11 KiB.

[5 Oct 2009 10:14] Tonci Grgin
Hi again Hal.

Same remarks as for Bug#47615... I am unable to create DAO.DBEngine.
[5 Oct 2009 20:24] Hal Lind
Hi Tonci,

See http://bugs.mysql.com/bug.php?id=47615 for same resolution.

Thanks for your help.
[12 Oct 2009 8:46] Tonci Grgin
Hal, nope. Won't work... See Bug#47615 for details on failure.
[13 Oct 2009 15:46] Hal Lind
Hi Tonci,

I went back to my test 64bit 2008 server, and I do get the same error as you when I use CreateObject("DAO.DBEngine"). 
If I use CreateObject("DAO.DBEngine.36") it works OK. Could you please verify that you are using "DAO.DBEngine.36"? If you still get the same error, then I am at a loss for the cause. Maybe there is some dependency that is missing. Since Bogdan was able to reproduce bug 47615, maybe he can try this one too?

Thank you for all your effort in re-producing this. We are converting our app from using a MS Access database to MySql and it's almost there. Just a few problems to work out (this is a big one though!!)

Thanks,
Hal.
[13 Oct 2009 16:00] Tonci Grgin
Hal, as I said, I tried both version (.36) and versionless code and it just won't work. As for Bogdan, I already notified him of this problem but can't promise anything. DAO is age old and he's rather busy. Lawrentiy also tried but run into problems creating work-space (if I remember correctly).

So, we will not disregard these problems (already 3 of us tried figuring out what's going on), we're just temporarily set back by my inability to check your code.

Good luck with transition!
[13 Oct 2009 19:22] Hal Lind
Thank you for trying. I know the technology is old. That is why we are trying to transition to something more modern. Our application suite is very large, with over 750,000 lines of source code. I am trying to get by with the least changes to be base code as possible. Once we get this working with MySQL we can then move on to a conversion to .NET.

The error Lawrentiy got probably was due to the fact that the msrdo20.dll was not copied and registered. 

Thanks again.
Hal.
[24 Feb 2010 14:11] Tonci Grgin
Bogdan, see Bug#47615 by Hal.
[7 Oct 2010 8:53] Bogdan Degtyariov
Finally, I was able to reproduce the problem.
The trick was to run 32-bit command line, which runs 32-bit version of the driver. Otherwise the error will be displayed because 64-bit DAO does not exist.
[7 Dec 2010 4:09] Bogdan Degtyariov
Verified with 5.1.8 (LONGTEXT is still truncated)
[7 Dec 2010 4:15] Bogdan Degtyariov
IMPORTANT NOTE: 
the script returns correct results with Connector/ODBC 3.51.27