Board index » delphi » "At beginning of Table"

"At beginning of Table"

Dear 'group,

(Paradox Tables with Delphi 2)

I'm getting the above error on my tables, when they're empty, or very
nearly.  Can't find any help on this error message, and it doesn't actually
tell me anything useful.

I'm only using standard TTables, TQuery's and TDatasources nothing out of
the ordinary, combined with standard Data-aware components (DBGrid, DBEdit
etc).

Anyone know more about this??

Ta

Stu

 

Re:"At beginning of Table"


Quote
Stuart Clennett (stu...@telemarque.karoo.co.uk) wrote:

: (Paradox Tables with Delphi 2)

: I'm getting the above error on my tables, when they're empty, or very
: nearly.  Can't find any help on this error message, and it doesn't actually
: tell me anything useful.

Well, if the table is empty, then both bot()[beginning of table]
and eot()[end of table] are true.  What is your code trying to
do when you get these error messages?
--
============================================================
Rick Carter   carte...@email.uc.edu   rcar...@tso.cin.ix.net
============================================================

Re:"At beginning of Table"


As far as I can remember, this error is caused by code fragments accessing
the same data component.  In short, I think an SQL statement issued by one
piece of code is invalidated by another code fragment.  Example :
.
.
sqlExample.SQL.Clear;
sqlExample.SQL.Add('SELECT TSTOCK_STOCKQTY FROM TSTOCK WHERE '+
 'TSTOCK_STOCKITEM = '+edtStockItem.Text);
sqlExample.Open;
.
.

Then in another piece of code, while the query componenet is still open :

.
.
edtStockName.Text := sqlExample.FieldByName('TSTOCK_STOCKNAME').AsString;
.
.

The table will be seen to be empty if the first code fragment returns no
records.
The solution, I think, is to open and close componenets as required, and
where possible, use a locally created query to manipulate data.

Hope that helps a little,

Martin Platt.

Quote
Stuart Clennett wrote in message <01bdf062$05cfaf00$11eb5cc3@jan>...
>Dear 'group,

>(Paradox Tables with Delphi 2)

>I'm getting the above error on my tables, when they're empty, or very
>nearly.  Can't find any help on this error message, and it doesn't actually
>tell me anything useful.

>I'm only using standard TTables, TQuery's and TDatasources nothing out of
>the ordinary, combined with standard Data-aware components (DBGrid, DBEdit
>etc).

>Anyone know more about this??

>Ta

>Stu

Re:"At beginning of Table"


Stuart Clennett skrev i meddelandet <01bdf062$05cfaf00$11eb5cc3@jan>...

Quote
>Dear 'group,

>(Paradox Tables with Delphi 2)

>I'm getting the above error on my tables, when they're empty, or very
>nearly.  Can't find any help on this error message, and it doesn't actually
>tell me anything useful.

>I'm only using standard TTables, TQuery's and TDatasources nothing out of
>the ordinary, combined with standard Data-aware components (DBGrid, DBEdit
>etc).

>Anyone know more about this??

I had the 'At beginning of table'-problem when I used an Autoincrement field
as the primary key. It occurred not only in the while not EOF-loops but also
when I used the Table.Last-button.
The problem disappeared when i got rid of the autoincrement field.

Kent Lindberg
Stockholm

Re:"At beginning of Table"


Rick,

This error occurs on a single line of code.  "MyTable.open".  And they're
not always empty tables.

Thanks for your interest.

Stu.

Richard Carter <carte...@news.ececs.uc.edu> wrote in article
<6vgcjj$es...@news.ececs.uc.edu>...

Quote
> Stuart Clennett (stu...@telemarque.karoo.co.uk) wrote:
> : (Paradox Tables with Delphi 2)

> : I'm getting the above error on my tables, when they're empty, or very
> : nearly.  Can't find any help on this error message, and it doesn't
actually
> : tell me anything useful.

> Well, if the table is empty, then both bot()[beginning of table]
> and eot()[end of table] are true.  What is your code trying to
> do when you get these error messages?
> --
> ============================================================
> Rick Carter   carte...@email.uc.edu   rcar...@tso.cin.ix.net
> ============================================================

Re:"At beginning of Table"


This error happens when you are using the Table1.Append and the table has no
records.

Example of Problem:

Dataset2 atached to Table2
Dataset1 attached to Table1

Table2.MasterSource := DataSet1
Table2.masterFields := 'SomeField'

If the mastersource makes no records available in Table2 and you try
to use Table2.Append you get this error.

I have found that this fixes the problem:

If (Table2.RecordCount > 0) then
  Table2.Append
else
 Table2.Insert;
    "
    "
    "
Table2.Post;

Quote
Richard Carter wrote:
> Stuart Clennett (stu...@telemarque.karoo.co.uk) wrote:
> : (Paradox Tables with Delphi 2)

> : I'm getting the above error on my tables, when they're empty, or very
> : nearly.  Can't find any help on this error message, and it doesn't actually
> : tell me anything useful.

> Well, if the table is empty, then both bot()[beginning of table]
> and eot()[end of table] are true.  What is your code trying to
> do when you get these error messages?
> --
> ============================================================
> Rick Carter   carte...@email.uc.edu   rcar...@tso.cin.ix.net
> ============================================================

Other Threads