C
chengjian
Unregistered / Unconfirmed
GUEST, unregistred user!
我将OleContainer 中的 WORD 文档,存入到数据库中,然后取出来显示,为什么出错?
代码如下:
OleContainer1.OldStreamFormat := True;
Word_FileStream := TFileStream.Create('TMP.doc',fmOpenWrite or fmCreate);
Word_FileStream.Position:=0;
try
OleContainer1.SaveToStream(Word_FileStream);
ADOQuery1.Edit;
TBlobField(ADOQuery1.FieldByName('filedefine_data')).loadfromStream(Word_FileStream);
ADOQuery1.Post;
MessageBox(Handle,'保存文件成功!','系统提示', MB_OK + MB_ICONINFORMATION);
ShowMessage('close');
OleContainer1.Close;
ShowMessage('load');
OleContainer1.LoadFromStream(Word_FileStream); ////出错了!
//出错信息:Stream read error
finally
Word_FileStream.Free;
end;
请各位大侠帮助!
代码如下:
OleContainer1.OldStreamFormat := True;
Word_FileStream := TFileStream.Create('TMP.doc',fmOpenWrite or fmCreate);
Word_FileStream.Position:=0;
try
OleContainer1.SaveToStream(Word_FileStream);
ADOQuery1.Edit;
TBlobField(ADOQuery1.FieldByName('filedefine_data')).loadfromStream(Word_FileStream);
ADOQuery1.Post;
MessageBox(Handle,'保存文件成功!','系统提示', MB_OK + MB_ICONINFORMATION);
ShowMessage('close');
OleContainer1.Close;
ShowMessage('load');
OleContainer1.LoadFromStream(Word_FileStream); ////出错了!
//出错信息:Stream read error
finally
Word_FileStream.Free;
end;
请各位大侠帮助!