Products

Price/Order

Support

Partners

Testimonials

Test Results

About us

Contact
 RtcDataSetToDelphi error when not using TClientDataset
Bottom
 
Total posts: 5
 Author RtcDataSetToDelphi error when not using TClientDataset
Johann Campbell

22.05.2007 23:31:36
Registered user
Hi, I am experimenting with getting results using RTC. However, the example provided uses a TClientDataset that works perfectly. When I use an in-memory dataset, an error occurs when trying to Append because no code returns the dataset to Active once it becomes Inactive to clear the FieldDefs.

Here is a snippet:

  if ClearFieldDefs then
    begin
    DelphiDS.Active:=False; <- Dataset set to inactive
    DelphiDS.FieldDefs.Clear;
    ... other code
    end;
  { Missing DelphiDS.Active := True}
  rtcDS.First;
  while not rtcDS.EOF do
    begin
    DelphiDS.Append;    <- error here

Can this be investigated further?

Thanks,

Johann
Glynn Owen [RTC]

23.05.2007 04:50:21
Registered user
I see your point, but when you say "in-memory dataset", what component are you using?

It appears to me that you could change -

rtcDS.First

by adding a line before it so that it reads -

DelphiDS.Active := TRUE;
rtcDS.First

I think I'm missing something, though, because I've been using this method for several months without any problems, although I am using it with a TClientDataSet. Since the DelphiDS parameter is typed as a TDataSet, I don't see why there would be any difference using some other TDataSet descendant, but I wouldn't be surprised to find that is the case.

Regards,
Glynn
Johann Campbell

23.05.2007 08:54:19
Registered user
Hi Glynn thanks for the reply. I am using TdxMemData from DevExpress. The probem occurs when trying to Append a record to an Inactive dataset (the TdxMemData) because you set it to Active := False when you cleared the FieldDefs.

Hope that helps.

Johann.
Danijel Tkalcec [RTC]

23.05.2007 09:36:13
Registered user
Hi Johann,

one solution to your problem is to modify the function in the RTC unit to set DelphiDS.Active to TRUE, as you have suggested, and I will make the same change in the RTC SDK before uploading the next version.

In case there are more things which TdxMemData requires to make this work, I would recommend you to copy the code from that unit to one of your units and make any modifications required, since the whole "rtcDBDataTypes" unit is there only for reference and should serve as an example. Since you are using an in-memory dataset which is not fully compatible with TClientDataSet, you will probably need to extend the function later anyway.

Best Regards,
Danijel Tkalcec
Danijel Tkalcec [RTC]

23.05.2007 22:52:30
Registered user
RealThinClient SDK 2.64 is now ready for download, including your suggested update to the rtcDBTypes unit.

Best Regards,
Danijel Tkalcec