TFieldDefs without TDataSet? lazarus / 5-Lazarus Extra Components ---------------------------------------------------------------------- ericisko · 2008-10-16 22:52 In FPC 2.2.0, I was able to do: FieldDefs := TFieldDefs.Create(nil); FieldDefs.Assign(MyQuery.FieldDefs); to store field definitions for the existing table for later use - eg. to validate text file line according to data types in the table - without keeping whole Query object. However, in FPC 2.2.2, I get Access Violation - in TDefCollection.SetItemName(). If I pass in TDataSet to TFieldDefs.Create() call, everything is OK. Is there a way to use TFieldDefs without TDataSet? Or should I use the list of TFieldDef objects instead? Any other suggestion to keep the list of fields in the table for later use? Thanks,   Erik ---------------------------------------------------------------------- tatamata · 2009-01-01 16:53 Why don't you try with MemDataset? Since it is in memory, it seems to be a good way for temporary storage of FieldDefs inormation. Put MemDtaset control on yor form and then you can create FieldDefs through code in this way: var   vFieldDef:TFieldDef; begin   vFieldDef:=MemDataset1.FieldDefs.AddFieldDef;   //and then add properties of the FieldDef...   vFieldDef.Name:='SomeName';   vFieldDef.DataType:=ftString;   vFieldDef.Size:=1000;   vFieldDef.Required:=False; Etc. ---------------------------------------------------------------------- Loesje · 2009-01-19 10:01 It was a bug in fpc, it's fixed in revision 12567