Re: CDatabase and UNICODE problem



bitkidoku wrote:

Hello all,
The archives of this group really helped me before, but now I am stuck
with a very hard problem. First of all thank you for your work :)

I have a project based on CDatabase and CRecordSet (the class I'm using
is this: CODBCAccess
http://www.codeproject.com/database/codbcaccess.asp). A lot of coding
had been done on my project.

Because of language character problems I changed my project to UNICODE.
Then my problems started. I had to change every occurance for char *
and CString conversions.
But I am really stuck with this database issues. CDatabase
automatically converts the query strings to an ansi version so I can
not insert UNICODE strings to database. And because of it is a core
library I can do nothing about it.
But CDaoDatabase supports UNICODE queries. So I want to change my
project such a way that it will use CDaoDatabase. But as I said before
it is a looong way to convert all database operations in my code. So I
am considering to write a new class that acts like CODBCAccess class (I
mean it's interfaces are same).

The thing I am asking is can you suggest a better way to do this? Or
are there any already implemented classes for this purpose? Or is
CDaoDatabase right choice?

I hope I am clear. Sorry for my poor English. Please don't hesitate to
ask questions to clarify my situations if I am not clear enough.

bitkidoku:

Can you store UTF-8 strings in the database? You can use WideCharToMultiByte() to convert from "Unicode" to UTF-8.

David Wilkinson
.