Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2006

    Question Unanswered: Access Text And Memo Fields Problem

    Hi all,

    I am trying to make a simple C++ Unicode CGI App to read text from an ACCESS Database. The App reads unicode text fine from TEXT fields, but when I try to read MEMO fields, I get some strange letters after converting it to UTF-8?
    Any ideas?

    here's some sample code
    CRecordset rs(&db);
    CStringW rsStr;
    // to convert to UTF-8
    WideCharToMultibyte (CP_UTF8,0,rsStr,MBpointer)
    cout << MBpointer; // print UTF-8 text

  2. #2
    Join Date
    Nov 2003
    Is the Memo data compressed. Some may not be and some may be depending upon the amount of data within the field.

    From Access Help:

    Access 2000 or later uses Unicode Compression (if the Unicode Compression property is set to Yes which is default). Unicode represents each character as two bytes, so the data in a Text or Memo field requires more storage space than it did in Access 97 or earlier, where each character is represented as one byte.

    When a field's Unicode Compression property is set to Yes, any character whose first byte is 0 is compressed when it is stored and uncompressed when it is retrieved. Because the first byte of a Latin character a character of a Western European language such as English, Spanish, or German is 0, Unicode character representation does not affect how much storage space is required for compressed data that consists entirely of Latin characters.

    Data in a Memo field is not compressed unless it requires 4,096 bytes or less of storage space after compression. As a result, the contents of a Memo field might be compressed in one record, but might not be compressed in another record.

    perhaps...maybe...just a thought. Either that or there are some control characters within the memo that simply are not processed within the field.

    Self Taught In ALL Environments.....And It Shows!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts