Linked Server SELECT's to DB2/400 Tables with a DBCS Character Field Fail (277871)



The information in this article applies to:

  • Microsoft OLE DB Provider for DB2 4.0 SP2
  • Microsoft OLE DB Provider for DB2 4.0 SP3

This article was previously published under Q277871

SYMPTOMS

When a Linked Server is configured to DB2/400 from Microsoft SQL Server by using the OLE DB provider for DB2, and a SELECT query is issued to retrieve data from a DB2/400 table that contains a DBCS fixed-length character field, the following error message may be returned:
OLE DB provider 'DB2OLEDB' returned unexpected length of data from fixed length field <field name>

CAUSE

The DB2 OLE DB Provider returns different values for the field length and the actual data size, which causes the SELECT to fail.

RESOLUTION

To resolve this problem, obtain the latest service pack for SNA Server 4.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

215838 How to Obtain the Latest SNA Server Version 4.0 Service Pack


STATUS

Microsoft has confirmed that this is a problem in Microsoft SNA Server version 4.0 Service Pack 2 (SP2) and 4.0 SP3.

This problem was first corrected in SNA Server 4.0 Service Pack 4.

Modification Type:MinorLast Reviewed:3/10/2004
Keywords:kbbug kbfix kbQFE kbSNA400PreSP4fix kbSNA400sp4fix KB277871