这是我做的一个程序的片段,实现显示table中存放的ole对象
procedure TLogonForm.Table1DataChange(Sender: TObject; Field: TField);
Var stream : TMemoryStream;
rc : TRect;
begin
If Not Table1.Active Then Exit;
If ( Table1.State = dsInsert ) Then
Begin
OleContainer1.DestroyObject;
OleContainer1.Refresh;
Exit;
end;
If Not ( Table1.State In [ dsBrowse, dsEdit, dsSetKey ] ) Then Exit;
stream := TMemoryStream.Create;
try
Table1.FieldByName('MEMO').SaveToStream( stream );
stream.Seek( 0, 0 );
OleContainer1.LoadFromStream( stream );
Finally
stream.Free;
End;
OleContainer1.Refresh;
end;