Article ID: 272951 - Last Review: April 28, 2008 - Revision: 5.1 FIX: Microsoft Access/Jet ODBC Driver returns size of 2 gigabytes for computed text columnsThis article was previously published under Q272951 On This PageSYMPTOMS
If you use the Microsoft Access (Jet) ODBC driver (Odbcjt32.dll version 4.0.5303.1), which is shipped with Microsoft Windows 2000 Service Pack (SP) 1, when you run statements that contain computed columns of a text data type, a call to the SQLDescribeCol ODBC API on the computed columns returns a column size of 2147483598 (2 GB). Applications that try to use the column size returned from the call to the SQLDescribeCol ODBC API, to determine how much memory to allocate for the column, fail with "Out of memory" error messages. Odbcjt32.dll version 4.0.5303.1 is also installed by Microsoft Data Access Components (MDAC) version 2.5, Service Pack 1. The problem may also occur in other Access ODBC drivers. For more information about this problem in Windows Vista, click the following article number to view the article in the Microsoft Knowledge Base: 940895
(http://support.microsoft.com/kb/940895/
)
On a Windows Vista-based computer, the SQLDescribeCol function and the SQLColAttribute function return the incorrect value of 2147483598 instead of the expected value of 255
CAUSE
Jet returns a column size of zero for computed columns, which the Jet ODBC driver interprets as an indication of a Long data type. Because of this, the Jet driver sets the column size to the maximum size allowed for Long data types, which is 2 GB. However, if the data type is a text data type (character or varchar) the type is still reported as SQL_VARCHAR, which should have a maximum size of 255. An example taken from an ODBC trace follows that demonstrates the returned 2 GB column size as the seventh (7th) argument: mdactest 65c-698 EXIT SQLDescribeCol with return code 0 (SQL_SUCCESS) HSTMT 01EC18D8 UWORD 2 UCHAR * 0x0012FAE4 [ 8] "Expr1001" SWORD 129 SWORD * 0x0012FA94 (8) SWORD * 0x0012FA86 (12) SQLULEN * 0x0012FA98 (2147483598) SWORD * 0x0012FA9C (0) SWORD * 0x0012FA9E (1) RESOLUTION
To resolve this problem, obtain the latest service pack for Microsoft Data Access Components 2.5. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
293312
(http://support.microsoft.com/kb/293312/
)
How to obtain the latest MDAC 2.5 service pack
If you use the Access ODBC driver (Aceodbc.dll) that is included in the 2007 Microsoft Office system, apply hotfix 941877 to resolve this problem.
The English version of this fix should have the following file attributes or later:For more information about hotfix 941877, click the following article number to view the article in the Microsoft Knowledge Base: 941877
(http://support.microsoft.com/kb/941877/
)
Description of the Access 2007 hotfix package: February 26, 2008
Date Version Size File name ----------------------------------------------------------- 08/29/00 4.0.5629.0 270,608 bytes Odbcjt32.dll WORKAROUND
In some cases, it may be possible to wrap the calculated field in a datatype conversion function such as CInt or CLng, which converts the results to a non-text datatype.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in Microsoft Data Access Components 2.5 Service Pack 2. MORE INFORMATION
This behavior can occur with any function that returns calculated values, which includes common functions like IIF, MAX, MIN, FIRST, RIGHT, MID, and so forth. NOTE: This hotfix also contains a fix for the issue outlined in the following Microsoft Knowledge Base article: 271177
(http://support.microsoft.com/kb/271177/
)
FIX: Unable to repair password protected database through ODBC Control Panel
Steps to reproduce behavior
REFERENCESFor more information, click the following article number to view the article in the Microsoft Knowledge Base:271177
(http://support.microsoft.com/kb/271177/
)
FIX: Unable to repair password protected database through ODBC Control Panel
| Article Translations
|
Back to the top
