3

I wonder whether in Delphi calling

Query1.Unprepare;

implicitly closes Query1, if it was previously active. Such that e.g. calling Next on it will fail.

You might say, just go ahead and try but I did on a 64-bit Windows 7 system and had all sort of problems with it until finally my BDE Administrator seems to be completely broken. So I decided to just ask this questions before I start to find out, how I can get BDE running on my system ;-)

Kit Fisto
  • 4,385
  • 5
  • 26
  • 43

1 Answers1

7

You can not use Prepare/Unprepare on an open dataset. you need to close it first.

unit DBTables;
...
procedure TQuery.SetPrepared(Value: Boolean);
begin
  if Handle <> nil then DatabaseError(SDataSetOpen, Self);
  ...
  // SDataSetOpen = 'Cannot perform this operation on an open dataset';
kobik
  • 21,001
  • 4
  • 61
  • 121