Hi Nigel
In below codes I can export all images of my database to a folder.
but in 15000 records is working good but for heavy database for example 50000 show error :''out of memory'.
I think which for each save picture for each record I most create BF TBlobField and free BF.
Also i use BF.free for this line //BF.Fre show error :'nvalid pointer position'.
my ram is 16 GB and windows 10 64bit.
Please help me.
procedure TMainForm.BitBtn9Click(Sender: TObject);
var BF: TBlobField;
begin
while( not(Mainform.ADOQuery_PictureTable.Eof)) do
begin
Mainform.spGetCardPicture.Close;
Mainform.spGetCardPicture.Parameters.ParamByName('@siCard').Value := Mainform.ADOQuery_PictureTable.FieldByName('sicard').AsInteger;
Mainform.spGetCardPicture.Open;
If not (Mainform.spGetCardPicture.FieldByName('photo').IsNull)
then
begin
BF := Mainform.spGetCardPicture.FieldByName('photo') as TBlobField;
BF.SaveToFile('c:\Export'+'\'+Mainform.ADOQuery_PictureTable.FieldByName(Field_name1).AsString+'.jpg');
//BF.Free;
Mainform.ADOQuery_PictureTable.Next;
end
else
begin
Mainform.ADOQuery_PictureTable.Next;
ProgressBar1.Position:=ProgressBar1.Position+1;
Label2.Caption :=IntToStr(ProgressBar1.Position)+'/'+IntToStr(Max);
end;
end;
end;
Best Regards
Ali Abbasi