Is there a bug in dbf_dbffile.pas, line 1344? If I add new field and try to restructure file, I get an error message. If this line is changed to TempSrcDef := DestFieldDefs.Items[lFieldNo]; then restructure is working fine.
Suppose you have existing table Dbf1. This is the procedure in short:
var dbff : TDbfFieldDefs;
Dbf1.Open;
dbff.Assign(Dbf1.DbfFieldDefs);
ft := TFieldType(leType.Tag);
dbff.Add(leFieldName.Text,ft,len);
Dbf1.Close;
Dbf1.RestructureTable(dbff,true);
Dbf1.Open;
I was using such procedure for years with old version 6.4.7 of TDbf in D2007.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does this happen with latest snapshot, currently revision 803, from https://sourceforge.net/p/tdbf/code/HEAD/tree/? If so, please confirm code needed to reproduce it and what the error message is.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you post a short program that reproduces this? As simple as you can, please.
Suppose you have existing table Dbf1. This is the procedure in short:
var dbff : TDbfFieldDefs;
Dbf1.Open;
dbff.Assign(Dbf1.DbfFieldDefs);
ft := TFieldType(leType.Tag);
dbff.Add(leFieldName.Text,ft,len);
Dbf1.Close;
Dbf1.RestructureTable(dbff,true);
Dbf1.Open;
I was using such procedure for years with old version 6.4.7 of TDbf in D2007.
Does this happen with latest snapshot, currently revision 803, from https://sourceforge.net/p/tdbf/code/HEAD/tree/? If so, please confirm code needed to reproduce it and what the error message is.