总结:在网上也有相关的贴子讨论clob,blob字段显示数据不全的问题,其实都是因为对于oracle的字段有些不理解,进行数据库应用开发,常握数据库知识也很重要。
修改代码
var
ms,ms1: TMemoryStream; //Memory Stream for blob insert
t :tfilestream;
begin
//创建内存流并保存图片框中位图
ms := TMemoryStream.Create;
ms1 := TMemoryStream.Create;
ms1.LoadFromFile('d:\ABEJ12024111D802355Z.pdf');
ms1.Position:=0;
ms1.SaveToStream(ms);
//Image1.Picture.Graphic.SaveToStream(ms);
ms.Position:=0;
with adoquery1 do
begin
close;
sql.Clear;
sql.Add( 'update eygle_blob set FPIC=:sfz1 where FID=:xh1');
parameters.ParamByName('xh1').Value:= 1;
parameters.ParamByName('sfz1').LoadFromStream(ms,ftBlob);
ExecSQL;
end;
ms.Free;
ms1.free;
end
----查找文件夹下某种类型的文件
--- FindFileName---目录名 Filetpye==文件类型 Tstr --返回值
procedure TForm1.FindFile(FindFileName, Filetpye: string; Tstr: TStrings);
var
FSearchRec,
DSearchRec: TSearchRec;
FindResult: integer;
function IsDirNotation(ADirName: String): Boolean;
begin
Result := (ADirName = '.') or (ADirName = '..');
end;
begin
if FindFileName[Length(FindFileName)]<> '\' then
FindFileName:=FindFileName+'\';
FindResult := FindFirst(FindFileName+'*.*', faDirectory, DSearchRec);
//tstr.Add(FindFileName+fsearchrec.Name);
while FindResult = 0 do
begin
if ((DSearchRec.Attr and faDirectory) = faDirectory) and not
IsDirNotation(DSearchRec.Name) then
begin
FindFile(FindFileName+DSearchRec.Name,Filetpye,Tstr);
// tstr.Add(FindFileName+fsearchrec.Name);
end;
FindResult := FindNext(DSearchRec);
end;
FindResult := FindFirst(FindFileName+'*.*',faAnyFile+faHidden+
faSysFile,FSearchRec);
// tstr.Add(FindFileName+fsearchrec.Name);
try
while FindResult = 0 do
begin
//ShowMessage(FindFileName+fsearchrec.Name);
if Pos(Filetpye,FindFileName+fsearchrec.Name)>0 then
begin
tstr.Add(fsearchrec.Name+'='+FindFileName+fsearchrec.Name);
end;
FindResult := FindNext(FSearchRec);
end;
finally
FindClose(FSearchRec);
end;
Findclose(DSearchRec);
end;