PRB: 32-bit BASIC Does Not Convert UNICODE/ANSI in Binary FieldLast reviewed: January 26, 1998Article ID: Q179845 |
The information in this article applies to:
SYMPTOMSWhen using a binary field to store text in a Microsoft Jet 2.5 or earlier database, 32-bit applications cannot read text written by 16-bit applications and vice versa.
CAUSEUnlike Memo fields, the 32-bit programs do no automatic ANSI/UNICODE conversion on binary fields.
RESOLUTION
STATUSThis behavior is by design.
MORE INFORMATIONBecause the nature of data in a binary field is not predetermined, BASIC does no conversion when reading or writing data to these fields. This behavior creates a problem when 16-bit and 32-bit programs inter-operate, because 16-bit programs represent text as ANSI characters (1 byte per character) and 32-bit programs normally represent text as UNICODE characters (2 bytes per character). 32-bit programs can represent text as ANSI, but require explicit use of the StrConv() function to translate between UNICODE and ANSI, for example:
strANSI = StrConv(strUNICODE, vbFromUnicode) strUNICODE = StrConv(strANSI, vbUnicode)This function can be applied to reading and writing BLOB data as well. WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
Steps to Reproduce Behavior
REFERENCESMicrosoft Visual Basic Help Topic: StrConv() (c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Malcolm Stewart, Microsoft Corporation Keywords : vb432 VB4WIN vb5all Component : dao jet Version : WINDOWS:4.0,5.0,7.0,97 Platform : WINDOWS Issue type : kbprb |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |