我正在开发一个Delphi XE3应用程序。在Windows 7上64位。 它写入SQLite3数据库并读回数据。SQLite3数据'腐败'
如果我使用dos cmdline读取数据,那很好。
但是,通过dbExpress控件在Delpih或使用SQLiteExpert返回的数据是垃圾。我有一个怀疑是使用64位Windows,但我完全难住。
任何想法乡亲?
命令行sqlite3的示出的敏感数据:
sqlite> select distinct * from flight;
1|38926|Wed, 13 Mar 2013 15:54:19 GMT|EE35|38927|EGBB|EGPD|ofp|100720
2|38926|Wed, 13 Mar 2013 15:54:19 GMT|EE35|38927|EGBB|EGPD|ofp|100720
Delphi代码(也试过TSQLQuery用同样的问题):
qrySelect := TSQLDataSet.Create(nil);
qrySelect.CommandType := ctQuery;
qrySelect.SQLConnection := conn;
qrySelect.CommandText := 'select distinct flight_brief_id, brief_id, brief_date from flight';
qrySelect.Open;
try
showmessage(inttostr(qryselect.Fields.Count)); // returns 3 as expected
qrySelect.First;
while not qrySelect.Eof do
begin
strA := qryselect.Fields[0].AsString;
strB := qryselect.Fields[1].AsString;
strC := qryselect.Fields[2].AsString;
qrySelect.Next;
end;
finally
qrySelect.Close;
end;
感谢。
看起来像一个错误的编码。你怎么写数据? – 2013-03-15 12:30:31
通过Delphi dbExpress组件或通过命令行sqlite3.exe – 2013-03-15 13:10:55
请显示代码和示例记录。 – 2013-03-15 13:37:39