[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 441
  • Last Modified:

VB6 access database which store unicode string

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
0
lungwa
Asked:
lungwa
  • 2
1 Solution
 
TDSnetCommented:
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.

Cheers,

Jack Pick
Total Data Solutions
0
 
lungwaAuthor Commented:
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
0
 
TDSnetCommented:
Same concept as the Stored Procedure:

select *
  from someTable
 where someField = N'SomeUnicodeValue'

Jack
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now