zeoslib+delphi2010 read a database create on delphi2007 err
Posted: 17.12.2010, 11:51
first sorry for my english I'M A Chinese
i have a database created on delphi2007 with zeoslib
i saved an icon file in then 'Icon' field(blob).
when i try to read then icon field with delphi2010+zeoslib 7.0
i got a error.
this is my code:
procedure TForm1.ReadClick(Sender: TObject);
begin
ZConnection := TZConnection.Create(nil);
try
ZConnection.Protocol := 'sqlite-3';
ZConnection.Database := ExtractFilePath(Application.ExeName) + 'STData.dat';
ZConnection.Connect;
if not ZConnection.Connected then Exit;
ZTable := TZTable.Create(nil);
try
ZTable.TableName:='Game';
ZTable.Connection:=ZConnection;
ZTable.Active:=True;
ZTable.First;
TBlobField(ZTable.FieldByName('Icon')).SaveToFile('c:\test.ico');
//my problem :
//in delphi 2007 the file test.ico is correct
//but in delphi2010 the file is a wrong file
finally
FreeAndNil(ztable);
end;
finally
FreeAndNil(ZConnection);
end;
end;
i have a database created on delphi2007 with zeoslib
i saved an icon file in then 'Icon' field(blob).
when i try to read then icon field with delphi2010+zeoslib 7.0
i got a error.
this is my code:
procedure TForm1.ReadClick(Sender: TObject);
begin
ZConnection := TZConnection.Create(nil);
try
ZConnection.Protocol := 'sqlite-3';
ZConnection.Database := ExtractFilePath(Application.ExeName) + 'STData.dat';
ZConnection.Connect;
if not ZConnection.Connected then Exit;
ZTable := TZTable.Create(nil);
try
ZTable.TableName:='Game';
ZTable.Connection:=ZConnection;
ZTable.Active:=True;
ZTable.First;
TBlobField(ZTable.FieldByName('Icon')).SaveToFile('c:\test.ico');
//my problem :
//in delphi 2007 the file test.ico is correct
//but in delphi2010 the file is a wrong file
finally
FreeAndNil(ztable);
end;
finally
FreeAndNil(ZConnection);
end;
end;