Hi
I'm using Delphi 2009 / MyDAC 5.90.0.56 in an IntraWeb 10 project.
I have one TMyQuery with SQL.Text which queries 2 tables through a single inner join. The StrictUpdate property has to be false of course during insert/update due more than one row affected and there are no problems querying both tables through the one TMyQuery except ...
All is OK until I want to use the TMyQuery fields editor. I can declare fields from either table OK and their properties appear in the object inspector eg. I want to set DisplayFormat. When I run the project with a TField(s) declared from either table, it fails with an EDatabase Error : Field (abc123 or whatever) Not Found.
The origin property of each field is empty (I thought MyDAC completed this automatically ?) but even if I try any combination for these eg. databasename.tablename.fieldname or just tablename.fieldname, I can't run the project with any TFields declared ... I'm just told they are not found.
This is probably really simple but at the moment I can't see what's wrong. Please can anyone help with this ? ... thanks
Pete B.
TMyQuery, cannot find any fields ...TField.Origin issue ?
To add fields to the dataset perform the following steps:
- Drop the TMyQuery component on a form.
- Set the SQL property.
- Right-click on the component to open pop-up menu.
- Click on the "Fields Editor..." menu.
- Right-click in the open window to call the pop-up menu.
- Select "Add all fields" item.
Set the TMyDataSetOptions.FieldsOrigin property to True to fill the Origin property of TField objects with the appropriate value automatically.
- Drop the TMyQuery component on a form.
- Set the SQL property.
- Right-click on the component to open pop-up menu.
- Click on the "Fields Editor..." menu.
- Right-click in the open window to call the pop-up menu.
- Select "Add all fields" item.
Set the TMyDataSetOptions.FieldsOrigin property to True to fill the Origin property of TField objects with the appropriate value automatically.
Hi Dimon, thanks for the reply but I'm afraid it doesn't help. I know that fields are added using the fields editor, this has already been done. I mentioned in my previous post that the fields are declared in the Delphi unit and that their properties are visible in the Object Inspector which would imply that I have already used the fields editor. The issue may well still be simple but I think it is a little deeper than that
The TMyQuery.Options.Origin property is True but I don't get the origin property of any of my fields automatically put in place ... as I mentioned before, I thought this should happen too.
Do you have any other ideas please
cheers
Pete B.
The TMyQuery.Options.Origin property is True but I don't get the origin property of any of my fields automatically put in place ... as I mentioned before, I thought this should happen too.
Do you have any other ideas please
cheers
Pete B.
Well I did say I thought the answer might be simple
As for the EDatabaseError, well as you mentioned ALL fields should be included, NOT just the ones needing property changes.
Now it's fixed but then I suppose it could be argued it wasn't really a problem
cheers
Pete B
... perhaps unsurprisingly, all you have to do here is also ensure that the Active property is True at design timeThe TMyQuery.Options.Origin property is True but I don't get the origin property of any of my fields automatically put in place ... as I mentioned before, I thought this should happen too.
As for the EDatabaseError, well as you mentioned ALL fields should be included, NOT just the ones needing property changes.
Now it's fixed but then I suppose it could be argued it wasn't really a problem
cheers
Pete B