Reading Unicode from Access with ADO
- From: "Tim" <tim@xxxxxxxxx>
- Date: 26 Jun 2006 03:44:14 -0700
Hi,
I'm trying to read Unicode data from an Access 2003 table into a D7 app. The data is in a Memo field (but I have also tried Text) and I'm using a TADODataSet to access the table (the connection string is "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\data\import.mdb;Persist Security Info=False").
The string I'm attempting to read is "Krzy?ańska", but I'm getting the following results:
This code:
UStream := TUnicodeStream.Create(''); // UnicodeStream is a descendant of TStream written by my predecessor
(ADODataSet1.FieldByName('field') as TBlobField).SaveToStream(UStream);
TntLabel.Caption := UStream.DataString;
UStream.Free;
produces "態慴穲湹azyna". If I use UTF8Decode(UStream.DataString) then the output is "????azyna".
After reading through the newsgroups and Google, I tried:
TntLabel.Caption := ADODataSet1.Recordset.Fields.Item[WideString('field')].Value;
However, I've only got this to produce "Katarzyna".
What am I doing wrong? Please forgive me if I'm doing something obvious, I've only just started on ADO after being tied to D4/the BDE for a long time.
Thanks in advance,
Tim
.
- Prev by Date: Re: Delphi 5.0 ADO with d5adoupdate2 fail with findNext ?
- Next by Date: Re: Refresh DB
- Previous by thread: Refresh DB
- Next by thread: TADOConnection error - connection string
- Index(es):
Relevant Pages
|