Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TntEdit and TntDBEdit with Tibetan unicode character in Delphi5

76 views
Skip to first unread message

dorji dukpa

unread,
Jan 23, 2006, 4:20:12 AM1/23/06
to

My application is designed using Delphi5 and SQLServer 2000. I've used Standard control TEdit text box for updating data. I build up a SQL string like "Name='" + txtName & "'" which is fed to a query component to execute and update the database.

Now some fields in my database are to be converted to Tibetan unicode characters. So I've decided to use equivalent control TntEdit, which supports unicode. I can type the Tibetan charaters onto the TntEdit controls very nicely. But when I try to save the data using the method stated above, all my unicode characters get converted to ???????.


Thanks

Dorji
Bhutan

Can anyone help me with this problem. My system upgrade project is already stalled for quite a long time.

Erik Lindberg

unread,
Jan 23, 2006, 9:45:32 AM1/23/06
to
Hello Dorji,

>use equivalent control TntEdit, which supports unicode. I can type the
Tibetan charaters onto the TntEdit >controls very nicely. But when I try to
save the data using the method stated above, all my unicode >characters get
converted to ???????.

Question marks tend to mark an unsuccesful conversion between Ansi and
Unicode.

I assume that you are storing Unicode string data in NCHAR and NVARCHAR
fields (as they are used in SQL Server for storing Unicode data), aren't
you?

Furthermore, you should use the 'N' prefix in your queries, so for instance
use
"Name=N'" + txtName & "'"
instead of
"Name='" + txtName & "'"

Hope this helps.

--
Best regards


Erik Lindberg
Product specialist / Multilizer VCL components 6.x beta
Multilizer
www.multilizer.com


Dorji

unread,
Jan 24, 2006, 2:00:59 AM1/24/06
to

Hello Erik,

Thank you for your prompt response. I do use NVARCHAR fields in the SQL Server. The prefix N (Name=N' + txtName + "'"), comes out to be wrong syntex for SQL Server as it would create something like this: Update tblBioData set Name=N'Dorji'. So I'm still stuck at this point.

Thanks

Dorji

Bernhard Geyer

unread,
Jan 24, 2006, 4:17:46 AM1/24/06
to
If yo didn't use n(var)char-Field, you can't save Unicode-Data to the
database. The (var)char-Fields are limited to add characters of the
actual codepage.

Dorji

unread,
Jan 24, 2006, 9:43:49 PM1/24/06
to

I am already using nvarchar fields. Actually I've no problems if I use TntDBEdit. But since my application is designed using TEdit (unbound text boxes), I would like to use the equivalent TntEdit to avoid so much extra work, which turns all values from my text boxes into ?????? even though I can type Tibetan characters.

Thanks

Dorji

Igor Siticov

unread,
Jan 25, 2006, 1:52:20 AM1/25/06
to
I can guess that the problem in Query component usage. Its SQL property is
of TStrings type, which doesn't support Unicode and once you put your
Unicode strings there it is converted to ANSI using default code page and
passed to server on execution.

--
Best regards.
TsiLang Components Suite - Best Globalization Tool 2004
http://www.tsilang.com

"Dorji" <va...@druknet.bt> wrote in message
news:43d6f3f5$1...@newsgroups.borland.com...

Bernhard Geyer

unread,
Jan 25, 2006, 1:55:07 AM1/25/06
to
Dorji schrieb:
AFAIK Delphi 5 have some Bugs in ADO-Implementation that avoid
Unicode-Support in some cases. Check QC for that.

Troy Wolbrink

unread,
Feb 1, 2006, 3:29:17 PM2/1/06
to
When you concatenate 'abc' + SomeWideString in Delphi 5, I seem to recall it
had an issue with not promoting the expression to WideString. The solution
would be to force the type:

WideString('abc') + SomeWideString

--Troy


0 new messages