ftAutoInc (only supported in TableLevel 7 or 25) is not working! lazarus / 16-Databases ---------------------------------------------------------------------- Robert W.B. · 2014-06-24 23:08 ftAutoInc (only supported in TableLevel 7 or 25) is not working in the suggested TableLevels! ftMemo is not working either with tablelevel 7 25! The errors on both the ft's is: dbf1:Field not found: MyDatafields If I switch them to string, it works fine when active is true on dbf1 /Rob ---------------------------------------------------------------------- BigChimp · 2014-06-25 06:05 What FPC version are you using? What is your code? BTW: you're right, ftautoinc is not supported in tablelevel 25 but the code should auto-upgrade to tablelevel 30 which does support ftAutoinc. ---------------------------------------------------------------------- BigChimp · 2014-06-25 06:32 The dbftool demo works ok for me with FPC 2.6.4 which suggests autoinc fields work: C:\Lazarus\fpc\2.6.4\source\packages\fcl-db\examples>dbftool --tablelevel=30 --createdemo ---------------------------------------------------------------------- Robert W.B. · 2014-06-25 22:40 Thanks for the reply BigChimp but, I tried level 30 but, it failed. Is there a limit to just 10 dbfield, that you can have in a table/dbf file? My Migraine program have 0-9-fields and when I try to add field number ten, I've got an error that say's: Can't find the field number 10 and than Lazarus delete the field number ten so, it's 0-9 fields again! This is my Lazarus spec: Lazarus 1.2.4 r45510 FPC 2.6.4 i386-win32-win32/win64 ---------------------------------------------------------------------- BigChimp · 2014-06-26 05:52 Quote from: BigChimp on June 25, 2014, 08:05:28 amWhat is your code? Thanks for the info on your version. Quote from: robbanux on June 26, 2014, 12:40:47 amIs there a limit to just 10 dbfield, that you can have in a table/dbf file? No, there shouldn't be. What happens if you extend e.g. dbftool to use more than 10 fields? ---------------------------------------------------------------------- Robert W.B. · 2014-06-26 18:11 I will send you the code in a zipfile. Please,see if you can add a new field ex: autoinc Field for ID and see what's happening! /Rob ---------------------------------------------------------------------- BigChimp · 2014-06-27 05:17 You code does not create a dbf file and won't run as it misses a dbf file. Edit: please look into setting dbf1.fillepathfull to the current directory or wherever you want mymigraine to store the records when the program starts. Also, you will need to let the program create a dbf programmatically if it doesn't exist yet (or include a dbf file in your installer). To test you hypothesis about only supporting 9 fields I would strongly suggest doing what I suggested before: extend the dbftool to have >=10 fields, then post the code along with results (error messages, succcess etc). If that works, the problem is in your code. If it doesn't, the problem is in tdbf and the extended dbftool can serve as a test case. Edit: (wild guess) are you sure the fields you need to add to your program are already present in the dbf? And that they have the right data type? Thanks.