How can I create TFields on the form by component

How can I create TFields on the form by component

Post by Mcmanama » Sun, 02 Feb 1997 04:00:00



Dear world wide delphi developer,              
  How can I create TFields on the form by component, Just like TTable's
field editor.
for example,
  MyComponent = class(TComponent)
    :
    :
    public
       constructor Create;
    :
    end;

    constructor Create;
    begin
        { If I want create TFields in here, WHAT CAN I DO ??????? }
    end;

 
 
 

1. HELP!!: Creating TField component at run-time.

Help!   I am trying to write a .DLL that includes some database
functions.  I have 2 functions (units) now that run when associated
with a form and i can use the fields editor to create the TField
components.  But I dont want to show a form, I want this to be just a
function.

I have been successful in creating the TTable component at run time
and accessing the fields via TABLE.FIELDS[x].  but I need a way to
create the TField components at run-time so that i can access the
fields by name rather than by column position.  I have tried the
following:

   TC_FieldName := TStringField.Create(nil);

This compiles, but then does not access the field in the table TC.
Then I added the following:

   TC_FieldName.DataSet := TC;
   TC_FieldName.FieldName := 'FIELD NAME';

This still compiled, but I still couldnt access the field in TC.
I tried changing the Create line to the following:

   TC_FieldName := TStringField.Create(TC);

Still compiled, but caused a GPF.

Im not even sure that this component needs to be "created" in this
manner since the online help is NON-EXISTENT for dynamically creating
TField objects!

Please tell me what Im doing wrong!!!

Thanks in advance.
Marc

2. Borland FTP Site

3. Using TField, TFieldDefs, TDataSet for developing special data access components (Trees, Nets, Many-to-Mant)

4. HR = 80040154 on OLEDB call to init instance of DB

5. Question about TField component.

6. Group By questions

7. Are there components to help create db forms ?

8. Setup Wizard in VB 3.0

9. D1-Tfield not in grid but on form-Possible

10. Weird error creating TField

11. creating a custom Tfield

12. Creating a TField-object (TMemoField) at runtime ?

13. How to create Persistent TFields at runtime????