'Lock file grown too large'

Hi all,
Does anybody know what subject is mean?
I call the next function in the loop several hundreds times and get subject.

function TDatabaseDlg.CheckHydroData(IDStation: Longint; nBasin: Integer): Boolean;
begin
Basin:=IntToStr(nBasin);
StrID:=IntToStr(IDStation);
with QueryData do
  begin
  Close;
  SQL.Clear;
  SQL.Add('select * from "'+Basin+Hydrology+'" where ID = '+StrID);
  Open;
  CheckHydroData:=RecordCount > 0;
  Close;
  end;
end; {CheckHydroData}

How I can avoid this troubles?

Thanks

Alexander