//试试我这个吧
用olecontainer显示的话
procedure savetodb;//保存到数据库
var
st:TStringStream;
begin
st := tstringstream.create('');
olecontainer1.createfromfile('c:/xxx.cdx',true);//也可以是..('xx.cdx',false);
olecontainer1.savetostream(st);
query1.sql.text := 'insert into TableX Doc_field values
oc';
query1.parambyname('cdx').asblob := st.datastring;
query1.execsql;
st.free;
end;
procedure loadfromdb;//从数据库载入
var
st:TStringStream;
blobsteam:Tblobstream;
begin
st:= tstringstream.create('');
blobStream := TBlobStream.Create(Table1cdx, bmRead);
if BlobStream.Size = 0 then begin
BlobStream.Free;
Exit;
end;
st.CopyFrom(BlobStream, BlobStream.Size);
st.position:=0;//可能直接
olecontainer1.loadfromstream(st);
//可能直接blobstream.position:=0,olecontainer1.loadfromstream(blobstream);也行
st.free;
BlobStream.Free;
end;