Board index » delphi » EDBEngineError: Capability not supported. Field.

EDBEngineError: Capability not supported. Field.

Hi

The following code worked fine with Delphi 1.0. With Delphi 2.0 it gives me
exception:
EDBEngineError: Capability not supported. Field.

The code is:
  CommonQuery1.Close;
  CommonQuery1.SQL.Clear;
  s := 'SELECT DISTINCT A.ID ID1, A.NAME NAME1, A.MEDIAID, B.ID,        
        B.WORKACTIID, B.SECNUM ' +
        'C.WPID, C.TOOLID ' +
        'FROM TOOL A, WORKPHAS B, WP_TOOL C ' +
        'WHERE B.WORKACTIID = ' + IntToStr(workActionId) +
        ' and C.WPID = B.ID ' +
        'and A.ID = C.TOOLID';

  CommonQuery1.SQL.Add(s);
  CommonQuery1.Open;

The last line raises the exception. Tables are Paradox 5.0 tables. This problem is
quite odd, because I have used same kind of code elsewhere in the program and this
is the only place it raises an exception.

I have another problem: Where in my Delphi 2.0 documentation can I found these
mysterious error messages explained?

Thanks for your help,

Kari Marttila
IIA Research Center, Helsinki University of Technology

 

Re:EDBEngineError: Capability not supported. Field.


Quote
Kari Marttila wrote:

> Hi

> The following code worked fine with Delphi 1.0. With Delphi 2.0 it gives me
> exception:
> EDBEngineError: Capability not supported. Field.

What seems to be the problem with BDE? I had another "Capability not supported"
exception with this code:

   UnRefQuery.Close;
   UnRefQuery.SQL.Clear;
   UnRefQuery.SQL.Add ('SELECT * FROM actions A ' +
                     'WHERE ' +
                     'A.DevProjId = IntToStr(devId) AND ' +
                     'A.Parent = 0 ' +
                     'ORDER BY A.Prev ASC');

   UnRefQuery.Open;

But using Database Desktop (Run SQL) this semantically same code worked just fine:

        SELECT * FROM actions A
        WHERE   A.DevProjId = 1 AND
                A.Parent = 0
                ORDER BY A.Prev ASC

I had two answers for my previous question (Thank you very much for them!). The
first one suggested that there might be primary key missing. The primary key
consists of two fields in ACTIONS table (DevProjId and ActId). The second one
suggested that some of the keys might be a secondary key and this could be the
reason for the failure. There are no secondary keys.

I think the problem is that the primary key consists of two fields. But I don't
understand why the SQL-clause worked in Database Desktop but not in Delphi, and why
this should be a reason for some failure (there must be thousands of reasons to use
TQuery for tables that have two fields as a key).

Thanks for your help,

Kari Marttila
IIA Research Center, Helsinki University of Technology

Re:EDBEngineError: Capability not supported. Field.


Quote
> I think the problem is that the primary key consists of two fields. But I don't
> understand why the SQL-clause worked in Database Desktop but not in Delphi, and why
> this should be a reason for some failure (there must be thousands of reasons to use
> TQuery for tables that have two fields as a key).

> Thanks for your help,

Not that I am going to be much help, I think my situation may have been
slightly simpler ;-)  I got the same problem when I was trying to query
a string field, and forgot to surround the condition with quotes.  From
the looks of your SQL, this does not appear to be the case.  But its
something to watch out for.

Mark.

Re:EDBEngineError: Capability not supported. Field.


Quote
Kari Marttila wrote:

>    UnRefQuery.Close;
>    UnRefQuery.SQL.Clear;
>    UnRefQuery.SQL.Add ('SELECT * FROM actions A ' +
>                      'WHERE ' +
>                      'A.DevProjId = IntToStr(devId) AND ' +
>                      'A.Parent = 0 ' +
>                      'ORDER BY A.Prev ASC');

>    UnRefQuery.Open;

How stupid of me! I should have looked at UnRefQuery.SQL.Text at first. "Add" should have
been:
   UnRefQuery.SQL.Add ('SELECT * FROM actions A ' +
                     'WHERE ' +
                     'A.DevProjId = ' + IntToStr(devId) + ' AND ' +
                     'A.Parent = 0 ' +
                     'ORDER BY A.Prev ASC');

A good lesson for me.

--
Kari Marttila
IIA Research Center, Helsinki University of Technology
Email: mailto:kmar...@tuta.hut.fi
WWW: http://www.tuta.hut.fi/people/kmartti/index.htm

Other Threads