I have a procedure when click a bitbutton, it open a dialog box to load some files, and add it into AdoQuery (AQSource1). When I add some files, this error appear :
"Multiple-step operation generater error. Check each status value."
Only when I add multiple files selected. But if I selected a file by a file there is no error at all... But sometimes if I select multiple files this error did not show up either.... Kind a confusing for me...
How to fix this ? in simple way...
PS: I use Windows 7 Pro SP1 64bit, Embarcadero Delphi 2010
procedure TFMain1.btImgLoad1Click(Sender: TObject);
var i : integer;
strFilename : string;
begin
if OpenDialog1.Execute then
begin
// Add selected file to DBase and show it on DBGrid
for i := 0 to openDialog1.Files.Count-1 do
begin
// ShowMessage(openDialog1.Files[i]);
strfilename := openDialog1.Files[i];
AQSource1.Append;
AQSource1source_fileurl.Value := strFilename;
AQSource1source_filename.Value := ExtractFileName(strfilename);
AQSource1source_dateadd.Value := date();
AQSource1source_timeadd.Value := Time();
AQSource1.Post;
AQSource1.Close;
AQSource1.Open;
end;
end;
end;