Unicode problem

Posted on 2004-11-05
Last Modified: 2010-05-02
I have to develop an application using Arabic Interface. For this I am using Microsoft Forms 2.0 object Library and also changed the settings in Control Panel Regional Settings. I am using unicode for the first time. I am not sure about the approach or the way to do the same. Can anyone tell me the correct way to store in Unicode so that it is language independent.
Question by:ubbott
    LVL 53

    Expert Comment

    VB6 cannot display unicode characters.
    You need to use 3rd party controls to do so.
    MS Office has FM20.dll that is able to show unicode, but ppl need an MS Office license to use it.

    Sources for third party Unicode controls:
    1. UniSuite at
    2. UniToolBox at
    3. Forms 2.0 Object Library.
       FM20.Dll - Microsoft® Office users already have Forms 2.0 Object Library installed. If not you can download and install it free as part of ActiveXControlPad at
       FM20ENU.Dll - Automatically installed with English versions of Office. Users who have installed Office with another language should check Windows\System32 folder for presence of this file. If it is not present you can download and install it free as part of ActiveXControlPad.
       Note: You must have FM20ENU.Dll present to make Forms 2.0 Object Library controls available in Vb6. In the IDE you will receive an error while attempting to place the control on a Form. Typical messge is System Error &H8007007E(-2147024770).
    LVL 16

    Accepted Solution

    VB6 controls cannot display Unicode characters, no, but VB6 uses Unicode for all its strings -- that is why there is LenB, ChrW, et al counterparts to many of the functions.

    The Microsoft Forms 2.0 object Library and FM20.DLL are the same thing.  

    When you say 'store' in Unicode, do you mean to a text file?  If so, do you know how to use the File System Object?  You can use it to store in UTF16/Unicode.  Place a reference to the Microsoft Scripting Runtime in your code and try the following small example of this in action:

          Dim myFSO as New Scripting.FileSystemObject
          Dim myTextStream as Scripting.TextStream

          Set myTextStream = myFSO.OpenTextFile("x:\mypath\myunicodefile.txt", ForWriting, True, TristateTrue)

                myTextStream.Write "My Ứתїč○đﻉ text"

          Set myTextStream = Nothing
          Set My FSO = Nothing

    The CreateTextFile() method of the FileSystemObject has the following properties:

          CreateTextFile(Filename As String, IOMode As Enum, CreateIfNotExist As Boolean, TristateFormat As Enum)

    Use ForWriting, ForReading, ForAppending as the IOMode and TriStateTrue for Unicode, TriStateFalse for ASCII, TriStateUseDefault for System Default.

    For more info on the FSO, go to

    You may also want to look up the APIs WideCharToMultibyte() and MultibyteToWideChar(), from, but it depends how far you want to go...


    LVL 16

    Expert Comment

    Ooops, it looks like these pages don't show unicode text, either!!  Typical.  This line:

            myTextStream.Write "My Ứתїč○đﻉ text"

    was a fancy unicode line of text.  Recreate it by changing that line to:

            myTextStream.Write "My " & ChrW(7912) & ChrW(1514) & ChrW(1111) & ChrW(269) & _
                                           ChrW(9675) & ChrW(273) & ChrW(65225) & " text"

    to see why I'm so disappointed!! ;-)


    Author Comment

    Hi Jimbobmcgee..
    Thanks for the comments. I had worked with FSO. In the example you had stored some data in text file using Cherw(). It works but if we have to use some database say SQL then can same is applied to that and moreover the way to read a unicode stored database.

    LVL 16

    Expert Comment

    I would have thought that, if the database fields will store a Unicode string (an nVarchar, for example), it would be OK.  As far as I know, the ADODB.Recordset object is Unicode-compliant.  VB6 String variables certainly are.  

    As such, I imagine you could pull data from Unicode fields into a recordset and output data using the FSO method...



    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now