Hello,
I'm trying to use TMemDataSet to replace TClientDataSet. A simple TMemDataSet.Append causes a "cannot perform this operation on a closed dataset.". What am I missing here? I have added the fielddefs and cannot append records?
Terry
TMemDataSet
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: TMemDataSet
Hello.
As an alternative to TClientDataSet, you can use the TVirtualTable component (you can find it at Tool Palette - Data Access section). The detail information about VirtualTable can be found in the UniDAC documentation. You can also see samples of using TVirtualTable in the UniDACDemo\VirtualTable demo.
The Append method can be called only for an open dataset, otherwise you will get the "cannot perform this operation on a closed dataset" error. To open a dataset, the Open method should be called.
As an alternative to TClientDataSet, you can use the TVirtualTable component (you can find it at Tool Palette - Data Access section). The detail information about VirtualTable can be found in the UniDAC documentation. You can also see samples of using TVirtualTable in the UniDACDemo\VirtualTable demo.
The Append method can be called only for an open dataset, otherwise you will get the "cannot perform this operation on a closed dataset" error. To open a dataset, the Open method should be called.
Re: TMemDataSet
Thanks for the insight. A TVirtualTable works as expected. When I call Open on TMemDataSet, I get an error "Assertion failure ...MemDS.pas, line 1115."
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: TMemDataSet
TMemDataSet is an inner class of UniDAC, you shouldn't create and use it directly.
Re: TMemDataSet
I need to track the changes(inserted record, deleted record, modified record) made to the TVirtualTable when using cached updates = true. Is there a property or method I can use todo this? I tried using UpdateRecordTypes and UpdateStatus but they were of no help.
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: TMemDataSet
Hello.
You can use the following to track data modifications in TVirtualTable:
1) UpdateStatus method - it returns the update status for the current record in the client dataset.
2) UpdateRecordTypes property - it specifies the records that are visible in a dataset when cached updates are enabled.
3) Data change event handlers, for example OnNewRecord and OnUpdateRecord.
TVirtualTable is inherited from the standard TDataSet class, so you may find the detailed information about these events, property, and method in the TDataSet class documentation.
You can use the following to track data modifications in TVirtualTable:
1) UpdateStatus method - it returns the update status for the current record in the client dataset.
2) UpdateRecordTypes property - it specifies the records that are visible in a dataset when cached updates are enabled.
3) Data change event handlers, for example OnNewRecord and OnUpdateRecord.
TVirtualTable is inherited from the standard TDataSet class, so you may find the detailed information about these events, property, and method in the TDataSet class documentation.