Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 06:03 AM
Daman
Guest
 
Posts: n/a
Default Retrieve and display unicode data using ADO and DB2 V7.2

Hi,

I am currently facing difficulty displaying chinese, japanese, russian
etc. characters. I am using VB 6 and ADO to query the DB2 Version 7.2
unicode database (UTF-8). The resultset that comes back contains
garbage characters for Chinese, Russian etc languages. The english
characters come back fine using ADO.

It seems that DB2 assumes that my application is NOT Unicode
compliant.

How can I make my application unicode compliant so that MSDASQL.1
makes all the right calls to DB2CLI?
I have tried using IBMDADB2 driver as well but the problem is still
there.

I have tried these things:
1) Setting the DB2CODEPAGE instance variable to 1208.
CLI trace shows that Applicaition code page = 1208 and DB2 Code page =
1208
I would have thought that DB2CLI will not do the code page conversion
as both the application and DB2 code pages are the same.

However, reading the CLI trace carefully revealed that DB2 is binding
the query columns using SQL_C_CHAR instead of SQL_C_WCHAR. According
to the DB2 documentation, for UNICODE applications, DB2 will
automatically bind columns using SQL_C_WHAR, thus preventing any data
loss.

I am completly stuck as to how to make my VB application a "UNICODE"
application so that I can retrieve the data in its UNICODE format and
not in ASCII format. My initial hunch is that DB2 is converting the
data to ANSII while fetching the information from the database. The
resultset that comes back to me is in ASCII format. How can I prevent
this?

I have opened a ticket with IBM but they don't have an answer for me
yet.

Any help is appreciated.

Any ideas!!!

Thanks.

--Daman
  #2  
Old November 12th, 2005, 06:04 AM
Mark Yudkin
Guest
 
Posts: n/a
Default Re: Retrieve and display unicode data using ADO and DB2 V7.2

VB6 automatically converts from its internal unicode representation to ASCII
for all external functions, thus DB2 is being told by VB6 to use ASCII even
when you try to access unicode data. This is a VB6 limitation, not a DB2
issue, and there is no official "workaround" as it is part of the VB6
design.

"Daman" <damanm2003@yahoo.ca> wrote in message
news:f41b131b.0312120734.5fca5bfc@posting.google.c om...[color=blue]
> Hi,
>
> I am currently facing difficulty displaying chinese, japanese, russian
> etc. characters. I am using VB 6 and ADO to query the DB2 Version 7.2
> unicode database (UTF-8). The resultset that comes back contains
> garbage characters for Chinese, Russian etc languages. The english
> characters come back fine using ADO.
>
> It seems that DB2 assumes that my application is NOT Unicode
> compliant.
>
> How can I make my application unicode compliant so that MSDASQL.1
> makes all the right calls to DB2CLI?
> I have tried using IBMDADB2 driver as well but the problem is still
> there.
>
> I have tried these things:
> 1) Setting the DB2CODEPAGE instance variable to 1208.
> CLI trace shows that Applicaition code page = 1208 and DB2 Code page =
> 1208
> I would have thought that DB2CLI will not do the code page conversion
> as both the application and DB2 code pages are the same.
>
> However, reading the CLI trace carefully revealed that DB2 is binding
> the query columns using SQL_C_CHAR instead of SQL_C_WCHAR. According
> to the DB2 documentation, for UNICODE applications, DB2 will
> automatically bind columns using SQL_C_WHAR, thus preventing any data
> loss.
>
> I am completly stuck as to how to make my VB application a "UNICODE"
> application so that I can retrieve the data in its UNICODE format and
> not in ASCII format. My initial hunch is that DB2 is converting the
> data to ANSII while fetching the information from the database. The
> resultset that comes back to me is in ASCII format. How can I prevent
> this?
>
> I have opened a ticket with IBM but they don't have an answer for me
> yet.
>
> Any help is appreciated.
>
> Any ideas!!!
>
> Thanks.
>
> --Daman[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,248 network members.