Dear Friends,
This is the first time I write here, but I need a very urgent help from you, to inform me how to solve this problem : How to read UNICODE Characters (UTF-8) from SQL database into Text Field in Visual Basic.
You shouldn't have any problems, as VB string variables are Unicode aware (UTF-16, actually). Most databases (Oracle, MS SQLServer) store them as UTF-16 as well. ADO is also Unicode aware (technically, VB and ADO use COM BSTR objects to pass strings around, and they know Unicode).
What *may* be throwing you off is if you are using the VB command window to inspect the variable's contents. The command window only uses an ANSI font, so any hi-bit characters will show up as garbage. But they're still OK in memory.
I would suggest you write a helper function that takes a string and writes it out to a text file. If you use the FileScriptingObject, be sure to set the Unicode flag, but the Win32 CreateFile api is probably better. You can call this function from your command window, passing the string. You won't have any problems viewing the file with Notepad, as it has full Unicode support.
Also -
If you're using ADO parameters to pass your Unicode data to your database, be sure and use the "W" version of the datatype constants:
[tab]adVarWChar
[tab]adWChar
[tab]adWText
Chip H.
____________________________________________________________________ If you want to get the best response to a question, please read FAQ222-2244 first
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.