🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internationalization
Article #794

"AsWideString" for TField, TParam?

#794
From: Paul Kienitz
Date: Thu, 25 Apr 2002 06:23
30 lines
2671 bytes
Okay, we're translating a fairly large Builder 5 project that uses ADO
database access into Japanese, which means everything has to support
unicode.  The database itself has already been converted to have unicode
text fields.  The user interface components are being replaced with
Eldos ones that support unicode.

The spot I'm stuck on right now is the SQL queries.  Because the SQL has
to be portable for different database providers, we'd better stick to 7
bit ascii in the text of SQL statements.  Also, we're accessing ADO
through the "Adonis" package, which provides descendents of TTable,
TQuery, and so on, which means that the visible string properties are
all 8 bit, even though the ADO COM interface is unicode.

In some places I need to do things like "SELECT * FROM foo WHERE
foo.User_ID = 'xxxx'", where 'xxxx' might be in Japanese.  So I figured
I'd use a parameter, using the Params property and/or the ParamByName
method of TQuery.  (Almost any SQL provider will support "WHERE
foo.USER_ID = :something", right?)  I can assign blobs to these params,
so wide strings should be no trouble, right?  Well, maybe.  There is an
ftWideString type for fields and params, but no AsWideString method to
set it.  For now I suppose I'll try just setting the param as a blob and
then changing the field type, but I'm not sure this won't run into
portability problems over issues like whether a given database uses
big-endian or little-endian unicode internally, or whether there should
or shouldn't be a byte-order-marker character.  Has anybody dealt with
this problem and come up with a foolproof method of either setting
WideString TParams, or otherwise inserting unicode literals into
portable SQL?

Thanks in advance...
Technical Details
Message-ID: <3CC7A0E7.64589939@prevaluate.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!peer.news.opaltelecom.net!out.nntp.be!propagator2-SanJose!propagator-SanJose!in.nntp.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10297d,91b6f764cd8d9b2f,start
X-Google-Attributes: gid10297d,public
X-Google-ArrivalTime: 2002-04-24 23:25:18 PST
Message-ID: <3CC7A0E7.64589939@prevaluate.com>
Date: Wed, 24 Apr 2002 23:23:35 -0700
From: Paul Kienitz <pkienitz@prevaluate.com>
X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internationalization
Subject: "AsWideString" for TField, TParam?
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 65.45.176.183
X-Trace: dnews 1019715814 65.45.176.183 (24 Apr 2002 23:23:34 -0700)
Lines: 33
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!peer.news.opaltelecom.net!out.nntp.be!propagator2-SanJose!propagator-SanJose!in.nntp.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews