Creating RunTime Fields: EDataBaseError 'Field 'Fieldname' is not of the expected type' 
Author Message
 Creating RunTime Fields: EDataBaseError 'Field 'Fieldname' is not of the expected type'

EDataBaseError 'Field 'FieldA' is not of the expected type'

I created a simple Paradox Table, with two Alphanumerical fields of
length = 10;
When I try to create at run-time of field object of type corresponding to
the fields (TStringField) I get the mentioned error:

procedure TForm1.Button1Click(Sender: TObject);
T : TStringField;
begin

  TableTrade := TTable.create(application);
  with TableTrade do
  begin
    databasename := 'E:\DELPHI\PROJECTS';
    TableName := 'try.db';
    Open;
    First;
  end; {with TableTrade do}

  TableTrade.Close;
  T := TStringField.Create(Self);
  T.FieldName := 'FieldA';
  T.Name := TableTrade.Name + T.FieldName;
  T.Index := 1;
  T.DataSet := TableTrade;
  TableTrade.FieldDefs.UpDate;
  TableTrade.Open;  --> EDataBaseError: 'Field 'FieldA' is not of the
expected type'.

What's wrong there??

Many Thanks for any answer.



Tue, 28 Jul 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Query:Field 'fieldname' not found

2. Field 'PHYSICALTYPE' not found

3. Field 'xxxxx' not fount

4. type field ''money''

5. Q: Blob Fields in Delphi2 Can't create a DB

6. 'Field cannot be zero length' error

7. 'Blob field has been modified' exception

8. Initializing an object's fields to 0's

9. ADO: 'Sort'-Property and calculated Fields

10. Filtering on fields with minus sign ('- ') in fieldname

11. Creating Paradox's files at runtime

12. Table1.FieldByName('x').DisplayFormat runtime problem.

 

 
Powered by phpBB® Forum Software