Subject Re: autoincrement problem
From Charlie <tm@tc.con>
Date Tue, 17 Oct 2023 12:10:13 -0400
Newsgroups dbase.getting-started

OK..  I put it into a program to run only once which I didn't understand before.

close tables
> > set procedure to :dUFLP:DBF7File.CC
> > oDBF7File = new DBF7File( "floss.dbf" )
> > oDBF7File.SetNextAutoIncValue( 293 )
> > oDBF7File = null
> > close procedure :dUFLP:DBF7File.cc
> > return

The button event is essentially....

fl.fields["category"].value = form.category1.rowset.fields["cat"].value
fl.save()
return

Cat is a filter I am using and it changes with a different selection.  But It is the only field I am populating at this time as I am in testing mode I guess.

I also tried this in command after running the little program line by line:

use floss.dbf
append blank
edit

But it always reverts back.  This time lr was 5 as it was probably my 5th time.  Hmmm  a 5th sounds pretty good right about now!  :)

Possibly it has something to do with the table as this is the directory that was trying to create tables as .db instead of .dbf.  

The reason I am using the autoinc in the first place is because i am using bookmarks a lot in this program.




> the use of the function is overkill. This should be a one-time thing to
> fix the value in the header of the .dbf file. If you are constantly
> changing it, then you are giving yourself a lot more heartburn than
> necessary.
>
> As Mervyn notes, maybe we need to see your append code ... because
> honestly this should take care of the issue.
>
> Ken
>
> --
> *Ken Mayer*
> Ken's dBASE Page: http://www.goldenstag.net/dbase
> The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
> dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
> dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
> dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm
> dBASE DOS to Windows Tutorial:
> http://www.golagain, so denstag.net/dbase/DtoWTutorial/00_Menu.htm
>