Board index » delphi » DBX Error: Operation Not Supported.

DBX Error: Operation Not Supported.

Hi all!

I use Delphi 6 Professional, Interbase 6.0 and dbExpress components.
I have a database with a table and the following statement:

 with SQLQuery1 do
       try
         Active := False;
         SQL.Clear;
         SQL.Add('SELECT * FROM TerminalLayout1');
         SQL.Add('WHERE term = :term');
         Params.ParamByName('term').Value := 'eg';
         Active := True;
         if RecordCount <> 0 then <-----------ERROR
           ShowMessage(IntToStr(RecordCount));
       finally
         Active := False;
       end;

In the marked line I get the following error.

---------------------------
Project1
---------------------------
DBX Error: Operation Not Supported.
---------------------------
OK
---------------------------

Does anyone know why I cannot use the RecordCount property?
TIA
Mario

 

Re:DBX Error: Operation Not Supported.


Ok, now I read that I am not supposed to use the RecordCount with a
statement that contains parameters.

Is there another way to read the number of records returned except
performing a loop from BOF to EOF and increasing a counter?

Thanks.

Quote
"Mario" <m.dam...@gantner.com> wrote in message

news:3d64f135@newsgroups.borland.com...
Quote
> Hi all!

> I use Delphi 6 Professional, Interbase 6.0 and dbExpress components.
> I have a database with a table and the following statement:

>  with SQLQuery1 do
>        try
>          Active := False;
>          SQL.Clear;
>          SQL.Add('SELECT * FROM TerminalLayout1');
>          SQL.Add('WHERE term = :term');
>          Params.ParamByName('term').Value := 'eg';
>          Active := True;
>          if RecordCount <> 0 then <-----------ERROR
>            ShowMessage(IntToStr(RecordCount));
>        finally
>          Active := False;
>        end;

> In the marked line I get the following error.

> ---------------------------
> Project1
> ---------------------------
> DBX Error: Operation Not Supported.
> ---------------------------
> OK
> ---------------------------

> Does anyone know why I cannot use the RecordCount property?
> TIA
> Mario

Re:DBX Error: Operation Not Supported.


Quote
>Is there another way to read the number of records returned except
>performing a loop from BOF to EOF and increasing a counter?

An option would be to perform another query and use COUNT(*) instead
of * to get the number of records.

--

Robert Love - (rlove at slcdug.org)
Salt Lake City Delphi Users Group - http://www.slcdug.org
Delphi JEDI - http://www.delphi-jedi.org
Turbopower TPX Member - http://www.turbopower.com

Re:DBX Error: Operation Not Supported.


Yes, I know, but I need the records.

Quote
"Robert Love" <rlov...@spamslcdug.org> wrote in message

news:3jkcmuon39akr39gm0tvc81316df6p1jrl@4ax.com...
Quote
> >Is there another way to read the number of records returned except
> >performing a loop from BOF to EOF and increasing a counter?

> An option would be to perform another query and use COUNT(*) instead
> of * to get the number of records.

> --

> Robert Love - (rlove at slcdug.org)
> Salt Lake City Delphi Users Group - http://www.slcdug.org
> Delphi JEDI - http://www.delphi-jedi.org
> Turbopower TPX Member - http://www.turbopower.com

Other Threads