[Lazarus] Unicode and DBAware

Joost van der Sluis joost at cnoc.nl
Wed Jul 23 22:46:44 CEST 2008


You could override the TDataset.DataConvert procedure or the
TDataset.Translate procedure and set the Transliterate property to true
of the TStringFields of which you want to convert the data.

If you e.g. use a TSQLQuery, you can add your own
TTransSQLQuery=class(TSQLQuery) and override one of the above
procedures.

Joost 

Op woensdag 23-07-2008 om 18:39 uur [tijdzone +0200], schreef JoshyFun:
> Hello Lazarus,
> 
> I'm now "upgrading" a Lazarus 0.9.24 DB project to 0.9.25 with by
> default unicode support. The problem is that the database can not
> currently be upgraded to be unicode compliant so it is using the
> default codepage meanwhile all the visual objects like dbgrid are
> unicode.
> 
> The problem is that when a text field has a "special" character
> (codepage) the string fails to be rendered displaying nothing (blank
> line) and I'm unable to find a way to insert the Utf8ToAnsi and
> AnsiToUtf8 conversions somewhere.
> 
> My layout is a non visual firebird connection which is linked to the
> visual object after form creation and the connection is linked to a
> SQLQuery -> DataSource -> DBGrid
> 
> May anybody help me in the best way to insert the necessary
> conversions ?
> 
> Note: I'm not using the fields definition in the SQLQuery object as at
> design time the database connection is not present in the form.
> 
-- 




More information about the Lazarus mailing list