Board index » delphi » Field <Field Name> does not have a corresponding component.

Field <Field Name> does not have a corresponding component.

In the ADO example project Shape.dpr the Orders dataset specifies a
TDatasetField called CustomersOrders to implement (as I understand it) the
nested dataset relationship between it and the Customers dataset.  How is a
TDatasetField implemented via the IDE?  I can find no component for the
declaration, yet if I make my own such declaration in a test project I get
the error 'Field <Field Name> does not have a corresponding component.
Remove the declaration?'  I can find no TDataset component in the (D5 Pro)
palette and no such object is declared anywhere in the Shape project's code.

--

"Relationships are hard. It's like a full-time job, and we should treat it
like one. If your boyfriend or girlfriend wants to leave you, they should
give you two weeks' notice. There should be severance pay, and before they
leave you, they should have to find you a temp."
Bob Ettinger

 

Re:Field <Field Name> does not have a corresponding component.


In article <39ac00c8_1@dnews>,
  "DRS" <d...@removethis.ihug.com.au> wrote:

Quote
> the error 'Field <Field Name> does not have a corresponding component.
> Remove the declaration?'

From my book:
Field <>.<> does not have a corresponding component. Remove the
declaration?
Possible Cause of Error
1. You have a reference in your .PAS file that has no corresponding
reference in the .DFM file.
2. You may get this error message after first receiving the Class <>
not found. Ignore the error and continue? error message and then
proceeding with the loading of the project (after ignoring the error
message).
3. You may have manually removed the reference to the field from
the .DFM file.
4. You may have modified the field declaration in the .PAS file. For
example, you may have changed:

type
 TForm3 = class(TForm)
 Label1: Tlabel;

to:

type
 TForm3 = class(TForm)
 abel1: Tlabel; {removed the L from Label1}

5. You may have attempted to manually add a class type to the Published
part of your unit file, like this:

type
 TForm1 = class(TForm)
 Image1: TImage;
 Chloro: Form; {This line causes the error}
 private
 { Private declarations }
 public
 { Public declarations }
 end;

Quick Fix
1. Select Yes to remove the declaration.
2. If you want to then reinsert the reference in the .DFM file, it is
easiest to add the component back to your form, which will
automatically reinsert the reference in the .DFM file.
3. Reinsert the reference in the .DFM file that you removed.
4. Restore the field declaration to match the components name in the
Object Inspector.
5. When adding class types, do not add them to the Published part of a
forms unit (.PAS) file. This is acceptable:

type
 TForm1 = class(TForm)
 Image1: Timage;
 private
 Concrete: Form;
 public
 { Public declarations }
 end;

Additional Information
5. It is more common to add class types to a Type declaration in a
component unit than in a form unit. This is how composite components
are created.
See Class <> not found. Ignore the error and continue? and Error
reading <> for more information about related error messages and
conditions.

Quote
> --

> "Relationships are hard. It's like a full-time job, and we should
treat it
> like one. If your boyfriend or girlfriend wants to leave you, they
should
> give you two weeks' notice. There should be severance pay, and before
they
> leave you, they should have to find you a temp."
> Bob Ettinger

--
Clay Shannon,
certified Delphi 5 developer,
author of the book "Developer's Guide to Delphi Troubleshooting"
(Wordware 1999)
and Delphi Informant "Best Practices" columnist (beginning in the May
2000 issue)

Sent via Deja.com http://www.deja.com/
Before you buy.

Other Threads