Board index » delphi » Dynamically Generating Tables at Runtime
Dave Ellis
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Dynamically Generating Tables at Runtime
Hi,
I'm trying to create a table at runtime - ie not pre-specified no of fields. 1st problem : I'm trying to use the same datatype and size TFieldType types datatype := Table1.FieldByName(SelectedField).Datatype; Which seem to be reading the right info - but when I try and use these Table2.FieldDefs.Add('VarName',datatype,size,false); The fields are seemingly created, but data won't write to them. Simply by Table2.FieldDefs.Add('VarName',ftString,20,false); Then things work - but this is not really ideal. Can possibly get around 2nd problem : I want to generate the AppendRecord statement at runtime as I 3rd problem : I'm using ftFloat - but my data is being rounded up to Help - any advice welcome! Thanks, Dave |