ACC1x: 255-Char String Displays Only 254 Characters with ODBC

Last reviewed: May 20, 1997
Article ID: Q100658
The information in this article applies to:
  • Microsoft Access version 1.1

SYMPTOMS

When you attach a remote table using ODBC, data in 255-character fields in the attached table appears to be truncated after the 254th character.

CAUSE

A data buffer is set one character too small to display all the data in the field. Note that only the display is being truncated, the data itself is unchanged.

RESOLUTION

Create a Memo or Note field to contain data that is 255 characters long.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version 1.1. This problem no longer occurs in Microsoft Access version 2.0.

Steps to Reproduce Problem

  1. Create a table in ORACLE or Microsoft SQL Server containing the following SQL statements:

        In Oracle:      CREATE TABLE Bug (Id NUMBER(10,0),
                               Field1 CHAR(255))
                        CREATE UNIQUE INDEX BugPK ON Bug(ID)
    
        In SQL Server:  CREATE TABLE Bug (Id INT, Field1 CHAR(255))
                        CREATE UNIQUE INDEX BugPK ON Bug(ID)
    
    

  2. Attach and view the table in Microsoft Access.

  3. In the ID field, enter the number 1. In Field1, enter 255 characters.

  4. Commit the record.

    Result: Only 254 characters are displayed in Field1.

An easy way to test this procedure is to create a macro called AutoKey, as follows:

   MacroName     Action
   ----------------------
   ^A            SendKeys

   AutoKey Actions
   ---------------
   SendKeys
      Keystrokes: {TAB}{a 255}
      Wait: No

If you reopen the table, move to the 255-character column, and press CTRL+A, the SendKeys action automatically enters the letter "a" 255 times.

ORACLE is manufactured by Oracle Corporation, a vendor independent of Microsoft; we make no warranty, implied or otherwise, regarding this product's performance or reliability.


Additional query words: ODBC Oracle truncate
Keywords : kbusage OdbcOthr
Version : 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : Info_Provided


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.