VB6 access database which store unicode string

Posted on 2005-04-06
Last Modified: 2010-04-17
if i have the database such as sql2000 which is stored a unicode string such as chinese characters, and i only can use VB6 to write a program to access it, how can I do the comparation or search, b/c somebody told me that the VB6 is not support unicode, please advice
Question by:lungwa
    LVL 6

    Accepted Solution

    Hi Lungwa,

    Do you mean how do you pass your search command to the database to retrieve the dataset..?  The only difference searching Unicode data is that there is one slight change to your search string.  You have to precede your criteria string with an upper case "N".

    For example:  To make a call to a stored procedure which takes a Unicode string as a parameter.

    Exec sp_Search_Unicode N'Search Criteria'

    And that's it.  As far as using Unicode characters in your application's forms, the standard Windows TextBox control will not display Unicode characters.  You need to use the TextBox control which belongs to the Microsoft Forms 2.0 Object Library.  Add this library to your Project Components and then just use the TextBox control from there just the same as you would the standard one.

    Hope this helps.


    Jack Pick
    Total Data Solutions

    Author Comment

    but right now is if I want to query something from the database , select * from something="--something unicode characters here ---", and the read the result back how can i do it
    LVL 6

    Expert Comment

    Same concept as the Stored Procedure:

    select *
      from someTable
     where someField = N'SomeUnicodeValue'


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    760 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

    15 Experts available now in Live!

    Get 1:1 Help Now