//保存
var
MS1, MS2: TMemoryStream;
begin
MS1 := TMemoryStream.Create;
MS2 := TMemoryStream.Create;
try
with ADOQuery1 do
begin
if not Active then Open;
MS1.WriteComponent(Self);
MS1.Position:=0;
ObjectBinaryToText(MS1, MS2);
Append;
MS2.Seek(0, soFromBeginning);
TBLOBField(FieldByName('tList')).LoadFromStream(MS2);
Post;
end;
finally
MS1.Free;
MS2.Free;
end;
end;
//载入
var
MS1, MS2: TMemoryStream;
begin
MS1 := TMemoryStream.Create;
MS2 := TMemoryStream.Create;
try
with ADOQuery1 do
begin
if not Active then Open;
TBLOBField(FieldByName('tList')).SaveToStream(MS1);
ObjectTextToBinary(MS1, MS2);
Self.DestroyComponents;
MS2.Seek(0, soFromBeginning);
MS2.ReadComponent(Self);
end;
finally
MS1.Free;
MS2.Free;
end;
end;
SMLPack 1.4 released! (VCL)
SMLPack is a suite of multilingual support components package for Delphi & C++Builder. It can help you to make your application support multilingual user interface easily and automatically.