New Bug "Unable to Find Record. Specified In the key."

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
luapfr
Posts: 37
Joined: Thu 11 Apr 2013 13:11

New Bug "Unable to Find Record. Specified In the key."

Post by luapfr » Sat 18 May 2013 14:36

I downloaded the latest version of IBDAC 5.1 and the same is with a new bug can not write records with ClientDataSet using Properties in TDataSetProvider

ResolveToDataSet = True
Options = [poAllowCommandText, poRetainServerOrder, poUseQuoteChar]
UpdateMode = upWhereKeyOnly

AndreyZ

Re: New Bug "Unable to Find Record. Specified In the key."

Post by AndreyZ » Mon 20 May 2013 06:28

The point is that when you use the upWhereKeyOnly update mode, TDataSetProvider tries to read primary key fields from the server. As we found out, the midas.dll library performs some internal work with the received information about primary key fields, which significantly slows down datasets opening. To prevent this, we added the PreventPSKeyFields global variable (defined in the DBAccess unit).
To avoid the problem, you can use one of the two ways:
- specify primary key fields in the TIBCQuery.KeyFields property;
- set the PreventPSKeyFields global variable to False. Note, that it may greatly influence performance.

luapfr
Posts: 37
Joined: Thu 11 Apr 2013 13:11

Re: New Bug "Unable to Find Record. Specified In the key."

Post by luapfr » Mon 20 May 2013 16:57

More this error did not occur in previous versions
why?
the variable "PreventPSKeyFields" was always set to false?
and could you give me an example of how to set this Code variable to False?

luapfr
Posts: 37
Joined: Thu 11 Apr 2013 13:11

Re: New Bug "Unable to Find Record. Specified In the key."

Post by luapfr » Mon 20 May 2013 17:13

Ok I got it and now there's more mistake I did

TForm1.FormCreate procedure (Sender: TObject);
begin
PreventPSKeyFields: = False;
end;

But this is something new in this latest version?
this should not be the UpdateMode property definitions automatically as the Provider was in previous versions?
If I use the UpdateMode as "upWhereAll"
is faster?

AndreyZ

Re: New Bug "Unable to Find Record. Specified In the key."

Post by AndreyZ » Tue 21 May 2013 06:52

We added the PreventPSKeyFields global variable in the latest IBDAC build. It is better to set PreventPSKeyFields in the initialization section:

Code: Select all

initialization
  PreventPSKeyFields := False;
The fastest way is to use the upWhereKeyOnly update mode, set the PreventPSKeyFields global variable to True (to avoid bug in the midas library), and specify primary key fields in the TIBCQuery.KeyFields property.

Post Reply