PRB: GetChunk/AppendChunk Methods Are Not Clearly Explained (259035)



The information in this article applies to:

  • The DAO SDK 3.51
  • The DAO SDK 3.6

This article was previously published under Q259035

SYMPTOMS

In the Microsoft Data Access Object (DAO) 3.51 document, the GetChunk/AppendChunk methods that belong to the Field object are not clearly explained. For both methods, the variant that holds the data that is being transferred is said to be of subtype string. This is not true when the database field is of type dbLongBinary (BLOB). In this case the correct variant subtype is an array of bytes.

RESOLUTION

Put binary data in arrays of bytes. Never assign arrays of bytes onto strings unless they have text semantic; that is, each byte represents an ASCII value that can be converted to a Unicode character.

MORE INFORMATION

If you choose a variant of subtype string or a string to store binary data, that choice can lead to the following two problems if a byte-to-Unicode conversion occurs:
  1. The physical size of the field is twice as big as the original binary data.
  2. The conversion is dependent on the current code page for the process (that is usually inherited from the system settings). An application may be unable to read its data if a different code page is currently selected because the data was written. Also, changes to a given code page to add new symbols can lead to the same problem.

Modification Type:MajorLast Reviewed:10/24/2003
Keywords:kbBug kbdocfix kbfix kbprb KB259035