Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread ElevateDB and Delphi TClientDataSet
Mon, Aug 25 2008 8:36 AMPermanent Link

Jan-Christian Lupander
When trying a setup with an EDBQuery connecting to a ClientDataSet through a DataProvider I run into problems when doing an ApplyUpdates on
the CDS.
The error message is "Unable to find record. No key specified".
As I use data, table layout and a component layout siniliar to what works with many other DBs I'm a bit lost as to where the problem really is.
Any pointers to examples of CDS use with ElevateDB would be greatly appreciated!

Jan-Christian
Mon, Aug 25 2008 2:18 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jan-Christian,

<< When trying a setup with an EDBQuery connecting to a ClientDataSet
through a DataProvider I run into problems when doing an ApplyUpdates on the
CDS.
The error message is "Unable to find record. No key specified".
As I use data, table layout and a component layout siniliar to what works
with many other DBs I'm a bit lost as to where the problem really is. Any
pointers to examples of CDS use with ElevateDB would be greatly appreciated!
>>

That's the entire error message ?  If so, then that's not an EDB error
message, so I'm not sure where it is coming from.  If you'd like to send me
an example of what you're trying to use for the CDS/EDB setup, I'll be happy
to look at it and tell you what needs changing.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Aug 26 2008 2:31 AMPermanent Link

Jan-Christian Lupander
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:

Jan-Christian,

<< When trying a setup with an EDBQuery connecting to a ClientDataSet
through a DataProvider I run into problems when doing an ApplyUpdates on the
CDS.
The error message is "Unable to find record. No key specified".
As I use data, table layout and a component layout siniliar to what works
with many other DBs I'm a bit lost as to where the problem really is. Any
pointers to examples of CDS use with ElevateDB would be greatly appreciated!
>>

That's the entire error message ?  If so, then that's not an EDB error
message, so I'm not sure where it is coming from.  If you'd like to send me
an example of what you're trying to use for the CDS/EDB setup, I'll be happy
to look at it and tell you what needs changing.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tim,

No, the first level message is "Record not found or changed by another user".
I gave the message coming up when clicking on "Continue" in the debugger error message box. Sorry.
I enclose a rehash of the SimpleQuery demo program, demonstrating my problem.
It should be run in the demo program environment.
Usage: Click on "Open CDS", two records should appear in the grid.
          Edit the information in line one, e.g, change Winston to Winstox.
          Click on next on the navigator in order to post the change.
          Click on "Apply Updates".

Jan-Christian



Attachments: Query_CDS.zip
Wed, Aug 27 2008 4:33 AMPermanent Link

Darren Davis
I experienced the same error message in Oracle and ADO. I had inherited some awful code and as part of that mess all the query fields had been
defined at design time - hence appearing in the source file and there was a hell of a lot of them. As part of the process of cleaning up the mess
when I removed them I got the same error.

The issue was related to the provider flags on the key field, which when created at design time had been supplied with the flags, but when supplied
dynamically were not. To address this issue without having to re-polute the source I used the AfterOpen event to supply the provider flags - in this
case to an TADOQuery.

procedure TfrmSimpleCustomer.oldCustAfterOpen(DataSet: TDataSet);
begin
 inherited;
 oldCust.Fieldbyname('custref').ProviderFlags:=[pfInUpdate,pfInWhere,pfInKey];
end;

Don't know if its the same issue you're having (haven't looked at your code) but its an avenue to check out anyway.

HTH

D.
Wed, Aug 27 2008 9:54 AMPermanent Link

Jan-Christian Lupander
Thanks Darren, but your solution did not work for me  |Frown
Error message remained exacly as before.

Jan-Christian
Wed, Aug 27 2008 2:48 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jan-Christian,

<< No, the first level message is "Record not found or changed by another
user". >>

Sorry about the delay in getting back to you on this.  It's a bug, but it is
caused by the way the common SQL resolver generates the parameters for the
UPDATE (and INSERT/DELETE).  It leaves the parameters as type ptUnknown,
which EDB does not like.  EDB expects that all parameters be assigned a type
to indicate whether they are input parameters, output parameters, or both
types of parameters.

A fix will be in the next build.  For now, the workaround is to generate a
sensitive result set and set the TDataSetProvider.ResolveToDataSet property
to True.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Aug 28 2008 12:51 AMPermanent Link

Jan-Christian Lupander
---
A fix will be in the next build.  For now, the workaround is to generate a
sensitive result set and set the TDataSetProvider.ResolveToDataSet property
to True.

--

Thanks Tim; that solved the problem!

Jan-Christian
Image