AdoUpdateContent里的SQL语句是(select content from oasmalldoc)
Word_FileStream := TFileStream.Create(Opendialog1.FileName, fmOpenRead);
try
Word_FileStream.Position := 0;
AdoUpdateContent.edit;
TBlobField(AdoUpdateContent.FieldByName('Content')).LoadFromStream (Word_FileStream);
AdoUpdateContent.Post;
finally
Word_FileStream.free;
end;
end;
上面代码执行后,所要打开的文档并没有以流的方式保存进CONTENT字段中,该字段内容仍然为NULL值,请教是何原因,谢谢!!!
Word_FileStream := TFileStream.Create(Opendialog1.FileName, fmOpenRead);
try
Word_FileStream.Position := 0;
AdoUpdateContent.edit;
TBlobField(AdoUpdateContent.FieldByName('Content')).LoadFromStream (Word_FileStream);
AdoUpdateContent.Post;
finally
Word_FileStream.free;
end;
end;
上面代码执行后,所要打开的文档并没有以流的方式保存进CONTENT字段中,该字段内容仍然为NULL值,请教是何原因,谢谢!!!
解决方案 »
- 求助 dbgrideh 字段中 如何显示 8位小数点
- delphi VCLUnZip 文件太大解压不了
- 关于websnap+intraweb+apache的问题,确实很需要帮助
- 如何设定tdatetimepicker的初值?
- 感谢棒棒糖!!
- 我的ID字段在数据库中是自动增加的,为什么当我在TTABLE中更新数据时,会出错,有什么解决办法?
- domdocument的编码格式如何指定
- 请问Application.handle指的是什么句柄???
- 怎么对一个文件在指定的位置写入任意指定的信息
- Delphi的快截键
- 用怎样的结构做软件比较灵活?
- 如果屏蔽ADO执行时的错误,就是不显示错误继续执行代码?
MemoStream : TStream;
begin
Word_FileStream := TFileStream.Create(Opendialog1.FileName, fmOpenRead);
try
Word_FileStream.Position := 0;
AdoUpdateContent.edit;
MemoStream:=AdoUpdateContent.CreateBlobStream(
AdoUpdateContent.FieldByName('Content'),bmWrite);
MemoStream.CopyFrom(Word_FileStream,Word_FileStream.Size);
finally
Word_FileStream.free;
MemoStream.free;
end;
AdoUpdateContent.Post;
end;
把try拿掉应有提示的,looklook。
另外同意楼上的。