Subject Re: autoincrement problem
From Andy Taylor <andy.taylor.1959@outlook.com>
Date Tue, 17 Oct 2023 17:45:06 +0100
Newsgroups dbase.getting-started

Hi Charlie,

What that tells me is that the beginAppend() command is working
correctly but dBASE thinks that there are no records in the table
because the table header that contains the next auto number is blank.

I assume that whem you review the records in the table the autoinc field
displays as blank.

I have seen this happen using XDML commands when you append records into
a table using the reindex option which skips updating indexes until the
end of the process.... at which point it just ignores the autoinc field.

So instead of:
    "append from MyOldTable reindex"
Just use:
    "append from MyOldTable"

That way it treats each record correctly and updates the autoinc field
as it goes.  It will take much longer to complete but it's a one off
thing anyway.

Hope that helps,
Andy

> Hi..  I am using autoincrement field type.  Seems to work ok if I append from a table.  But when I try to add using beginappend() instead of increasing the number in the field it goes back to 1.  I tried alter table but couldn't get that to work either.  I have the field indexed.  Not sure if that could be causing the problem.