Microsoft KB Archive/100658

{|
 * width="100%"|

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

 * }

Q100658

-

The information in this article applies to:


 * Microsoft Access 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
  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)  Attach and view the table in Microsoft Access. In the ID field, enter the number 1. In Field1, enter 255 characters. 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

Issue type : kbbug

Technology :