ODAC 9.3.9 not searching Key Fields
-
- Posts: 26
- Joined: Fri 28 Jun 2013 20:26
ODAC 9.3.9 not searching Key Fields
Hí,
After installation of new version, combo box in Object Inspector for KeyFields property on Smartquery is not listing the key fields automatically. We have already chacked UpdatingTable property and if te PK constraint is enabled.
We can set it manually, but we are in middle of a conversion from BDE to ODAC and there are too many data sets, so it´s out of question.
We use Delphi 7 and Delphi 2010.
After installation of new version, combo box in Object Inspector for KeyFields property on Smartquery is not listing the key fields automatically. We have already chacked UpdatingTable property and if te PK constraint is enabled.
We can set it manually, but we are in middle of a conversion from BDE to ODAC and there are too many data sets, so it´s out of question.
We use Delphi 7 and Delphi 2010.
Re: ODAC 9.3.9 not searching Key Fields
Hello,
Filling in the Published properties of the components is incorrect - we have fixed the behavior. However, this will not affect components' functioning, since when generating INSERT/UPDATE/DELETE and other queries, the key field will be still retrieved from the database and queries will be generated correctly.
Filling in the Published properties of the components is incorrect - we have fixed the behavior. However, this will not affect components' functioning, since when generating INSERT/UPDATE/DELETE and other queries, the key field will be still retrieved from the database and queries will be generated correctly.
-
- Posts: 26
- Joined: Fri 28 Jun 2013 20:26
Re: ODAC 9.3.9 not searching Key Fields
Thanks for the reply.
If I cannot fill in the published properties then why make the property in question published?
In previous versions the FindKey() function only works when KeyFields is set, that's why we needed to use ObjectInspector, to speed up conversion.
If we leave this property in blanks will FindKey() works??
Thanks,
If I cannot fill in the published properties then why make the property in question published?
In previous versions the FindKey() function only works when KeyFields is set, that's why we needed to use ObjectInspector, to speed up conversion.
If we leave this property in blanks will FindKey() works??
Thanks,
Re: ODAC 9.3.9 not searching Key Fields
Published properties must be filled in manually by developer, not inside components, i.e., you should set the KeyFields property by yourself. Even if this field is not set, the FindKey method will work correctly, since before searching records, keys will be searched in the table, and if the key field is detected - search will be performed by it.
-
- Posts: 26
- Joined: Fri 28 Jun 2013 20:26
Re: ODAC 9.3.9 not searching Key Fields
Hi Alex!
Thanks for your reply, now I understand. Helped a lot.
Thanks
Thanks for your reply, now I understand. Helped a lot.
Thanks
Re: ODAC 9.3.9 not searching Key Fields
You are welcome. Feel free to contact us if you have any further questions.
-
- Posts: 26
- Joined: Fri 28 Jun 2013 20:26
Re: ODAC 9.3.9 not searching Key Fields
Sorry, but not setting the KeyFields doesn't work. The FindKey() method still needs the KeyFields property to be set. A thing that I haven't mentioned before, is that I use the AutoClose option set to true. FindKey() needs the cursor to be open to work??Post by AlexP » Thu 03 Jul 2014 09:34
Published properties must be filled in manually by developer, not inside components, i.e., you should set the KeyFields property by yourself. Even if this field is not set, the FindKey method will work correctly, since before searching records, keys will be searched in the table, and if the key field is detected - search will be performed by it.
Re: ODAC 9.3.9 not searching Key Fields
When using the FindKey() method, we are trying to find key fields in the following order:
1) The fields specified in the KeyFields property;
2) Key fields in the specified table (from metadata)
If the fields are not found, you will get an error "Key fields required to call FindKey or FindNearest".
The error means that you have no key fields in your table.
Yes, this method works only on an open DataSet.
1) The fields specified in the KeyFields property;
2) Key fields in the specified table (from metadata)
If the fields are not found, you will get an error "Key fields required to call FindKey or FindNearest".
The error means that you have no key fields in your table.
Yes, this method works only on an open DataSet.