Questions tagged [tclientdataset]

TClientDataset represents an in-memory dataset implementing a database-independent dataset. It is defined in the DBClient.pas unit.

TClientDataset represents an in-memory dataset implementing a database-independent dataset. It is also known as MyBase. It is defined in the DBClient.pas unit.

299 questions
4
votes
3 answers

TClientDataSet used as in-memory dataset - is it possible to apply the updates in-memory without saving the data to a database?

By default, the TClientDataSet tracks all the changes made in the DataSet (inserts, updates, deletes). Is there a way to tell the dataset to accept the current changes (after a series of inserts using insert/post, let's say) without actually calling…
boggy
  • 3,674
  • 3
  • 33
  • 56
4
votes
1 answer

How to sort a ClientDataSet on a calculated field?

I'm trying to sort a ClientDataSet on a calculated boolean field, but for some reason the data is not sorted. I have a boolean field named Highlight with FieldKind set to fkInternalCalc, and an index defined like this: IndexDefs[0].DescFields =…
iMan Biglari
  • 4,674
  • 1
  • 38
  • 83
4
votes
1 answer

Avoiding memory corruption in ClientDataSets with poPropagateChanges and poFetchDetailsOnDemand?

Apologies in advance for a rather large reduced program to show the problem... Full code at the end of my question. I've got a program using TClientDataSet extensively, sometimes leading to error messages for what as far as I can tell is correct…
user743382
4
votes
1 answer

What is the difference between TDataSet and TClientDataset memory management?

I'm using TIBDataSet to fetch records from Firebird database table using Delphi 2007. There is about 1 million records in that table and I'm getting the Out of memory error. The same query runs correctly with TClientDataset though. Can you please…
4
votes
1 answer

Can I create TDataSetFields at runtime?

I have a simple code which creates a copy a dataset and all of it's detail datasets at runtime: DestDataSet.FieldDefs.Assign(SourceDataSet.FieldDefs); SourceDataSet.GetDetailDataSets(DetailList); for i := 0 to DetailList.Count - 1 do …
iMan Biglari
  • 4,674
  • 1
  • 38
  • 83
4
votes
1 answer

Obtain Trigger generated values after ApplyUpdates with a TClientDataSet

I have a (Firebird) DB. For most of my tables I have a trigger which fires before insert which will create the Primary Key (PK) for me via a generator as well as write to the newly inserted records a Created Date value and a Created By value. I…
Jason
  • 2,572
  • 3
  • 34
  • 41
4
votes
1 answer

TClientDataset - is it possible to filter by unicode column name?

I have a TClientDataset which could contain column names with non-ascii characters. It seems that I can not filter on such columns. Here is an example code: uses DB, DBClient; {$R *.dfm} procedure TForm34.FormActivate(Sender: TObject); var …
Wodzu
  • 6,932
  • 10
  • 65
  • 105
4
votes
1 answer

Why does't OnEditError or OnPostError catch an invalid user entry in TClientDataSet?

I have an in-memory dataset attached to a TDBGrid via some datasource. The problem is that an AV (validation error) is fired whenever the user enters a minus sign in a numeric field and presses either ENTER or navigates to another record. I am not…
Experience
  • 98
  • 8
4
votes
1 answer

PHP append to ClientDataSet CDS File

I have an empty Delphi ClientDataSet CDS File setup with all the Columns/Headers/Datatypes that I need. I want to use PHP to append an associative array into CDS rows. Is this possible? The array could simply be: { 1: {Name:Captain,…
skibulk
  • 3,088
  • 1
  • 34
  • 42
4
votes
1 answer

PHP - MYSQL to ClientDataSet

I don't know much about Delphi / ClientDataSets but I'm willing to look into it. I have a question before I pursue it though, to determine if what I want to achieve is feasible. I want to use a PHP script to save a dozen subsets of my MYSQL database…
skibulk
  • 3,088
  • 1
  • 34
  • 42
4
votes
2 answers

TClientDataset ApplyUpdates error because of database table constraint

I have an old Delphi 7 application that loads data from one database table, make many operations and calculation and finally writes records to a destination table. This old application calls ApplyUpdates every 500 records, for performances…
Jako
  • 2,489
  • 3
  • 28
  • 38
3
votes
2 answers

How do I use an aggregate field in a TClientDataSet that is a BIGINT (TLargeintField)?

I need to calculate the Max value of a field, but I'm having troubles doing so. Let's say that my field is named 'VALUE0'. I would like to use the aggregate functions of TClientDataSet to do so. What should I do? This code will fail only with fields…
ivarec
  • 2,542
  • 2
  • 34
  • 57
3
votes
3 answers

Master-detail using ClientDataSet.AppyUpdates with separate DataSetProvider

I use two ClientDataSets for a master-detail relationship with a DataSetProvider for each CDS. I don’t use a nested CDS for the detail, since I do an in-memory filtering for the master-detail relationship. The problem I have is when I need to apply…
markus_ja
  • 2,931
  • 2
  • 28
  • 36
3
votes
1 answer

'GetCalcFields' not found in base class Error

type TCDSWithRecalc = class(TClientDataset) public procedure GetCalcFields(Buffer: PChar); override; end; procedure TCDSWithRecalc.GetCalcFields(Buffer :PChar); begin inherited GetCalcFields(Buffer); end; E2137 Method 'GetCalcFields'…
Gültekin
  • 31
  • 2
3
votes
1 answer

How to detect user either in DBGrid or ClientDataset has deleted data in a cell at runtime?

I have a procedure that needs to be triggered/fired by a user deletion of data in a cell. Looks like ClientDataset.Delete is not appropriate for this case. My data structure are: TADOConnection -> TADOQuery -> TDataSetProvider -> TClientDataSet ->…
RickyBelmont
  • 619
  • 4
  • 11