Board index » delphi » Unhelpful EDBEngineError: 'At beginning of table'

Unhelpful EDBEngineError: 'At beginning of table'

I get the very unhelpful EDBEngineError 'At beginning of table' when I
open a query which seems to work normal most of the time.
The SQL statement in the query is a simple select statement with one
parameter (in case that's important).

I got no clue what causes this error. I've checked the database it's
querying on, it should simply produce a set of records matching the
value assigned to the parameter (there are several), but all I get in
this specific instance is this message from which I don't even
understand what the problem is. If anyone knows in what situations this
error might occur I would appreciate them telling me.

Thanks,
-------------------------------------------------
|                                       E Y E   |
| Aiko Gieskens                       C O M     |
| a...@euronet.nl                   I M A       |
|                                 G E S         |
-------------------------------------------------

 

Re:Unhelpful EDBEngineError: 'At beginning of table'


Aiko,

Do you have Filtered set to true?
If so, do the following check:

If MyQuery.BOF and MyQuery.EOF then
  MyQuery.Filtered := True;

Quote
Aiko Gieskens wrote:

> I get the very unhelpful EDBEngineError 'At beginning of table' when I
> open a query which seems to work normal most of the time.
> The SQL statement in the query is a simple select statement with one
> parameter (in case that's important).

> I got no clue what causes this error. I've checked the database it's
> querying on, it should simply produce a set of records matching the
> value assigned to the parameter (there are several), but all I get in
> this specific instance is this message from which I don't even
> understand what the problem is. If anyone knows in what situations this
> error might occur I would appreciate them telling me.

> Thanks,
> -------------------------------------------------
> |                                       E Y E   |
> | Aiko Gieskens                       C O M     |
> | a...@euronet.nl                   I M A       |
> |                                 G E S         |
> -------------------------------------------------

Re:Unhelpful EDBEngineError: 'At beginning of table'


Aiko,
  There is a bug in the DB.PAS source code that checks for EOF but not
for
    BOF and hence the "beginning of table exception".
  The simple solution is simply to put the Open method of the query
inside a
   try..except statment and if the message is "at beginning of table "
simply
   ignore it.
  The other solution is to change the DB.PAS unit and then recompile it
and
    use it instead of the original one. Check for a Case statment in
the
    DB.PAS unit that looks like this :
         Case . ...
            EOF : ....

   And simply add the BOF check to the case statment.

Eyal.

Other Threads