关于MEMO读取的问题(UNCOIDE编码)
用dephi或c++bulid
怎样从ACCESS中读取MEMO中的数据(uncoide编码)再存储到另一个表中同样是Memo属性
例如数据:
a
א (האות הראשונה ב-ABC הלועזי); תווית לשם עצם לא מיודע
我自己写进去是乱码,
我的代码如下
data-> Close();
data-> SQL-> Clear();
data-> SQL-> Text = "delete * from result_israel ";
data-> ExecSQL();
data-> Close();
data-> SQL-> Clear();
data-> SQL-> Text = "select * from dictionary_israel where jiexi <> ' ' order by id ";//解释 is not null order by id ";
data-> Open();
ProgressBar1-> Max = data-> RecordCount;
ProgressBar1-> Min = 0;
for(int i=0; i <data-> RecordCount; i++)
{
WideString jieshi,tempstr, kong = "\r\n ";
WideString word = data-> FieldByName( "Word ")-> Value;
WideString datastr = data-> FieldByName( "jiexi ")-> Value;
int pos;
pos = datastr.Pos( "\n ");
if(pos == 0)
{
data-> Next();
ProgressBar1-> Position += 1;
continue;
}
tempstr = datastr.SubString(1,pos - 2);
if(tempstr != word)
{
data-> Next();
ProgressBar1-> Position += 1;
continue;
}
jieshi = datastr.SubString(pos + 1,datastr.Length() - pos);
write-> Close();
write-> SQL-> Text = "insert into result_israel (Word,jiexi) values (:a, :b) ";
write-> Parameters-> Items[0]-> Value = word;
write-> Parameters-> Items[1]-> Value = jieshi;
write-> ExecSQL();
ProgressBar1-> Position += 1;
data-> Next();
}
ShowMessage( "ok! ");
望各位大虾们帮个忙谢谢!!!!!!!!!!
[解决办法]
a.把ACCESS数据库的内容导入到SQL数据库中,然后把原来的备注类型该为nvarchar类型,然后如下代码就可以了,
procedure TTntForm1.TntDBGrid1CellClick(Column:TColumn);
var
MyVariant : widestring;
begin
TntRichEdit1.Clear;
//Column.Field.Value
MyVariant:= Column.Field.Value;
TntRichEdit1.Lines.Add(MyVariant);
end;