tclientdataset

MidasLib.dcu makes the application slower

你离开我真会死。 提交于 2019-12-28 20:39:02
问题 I´m declaring MidasLib to avoid dll hell caused by Midas.dll in some clients. The code below runs in about 2350ms. If I remove the MidaLib declaration in uses it starts to run in just 45ms!! The data.xml file was saved with TClientDataSet.SaveToFile method, has 5000 records and its size is about 600Kb. Does anybody knows how to explain this weird behavior? I can confirm the problem in Delphi XE2 upd 3 and in Delphi XE3 upd 2. Thanks. program Loader; {$APPTYPE CONSOLE} {$R *.res} uses MidasLib

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

谁都会走 提交于 2019-12-23 12:26:14
问题 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 the database to save anything? One idea that I thought of was to use a TDataSetProvider and implement the BeforeUpdateRecord event and set the Applied parameter to true. I don't like two things about this. I have to add two more objects

Insufficient memory when opening TClientDataSet with a REPLACE in the underlying query

牧云@^-^@ 提交于 2019-12-22 10:44:16
问题 My Delphi code opens a TFDQuery (FireDAC), then opens the TClientDataSet connected to it via a TDataSetProvider : ClientDataSetData.Close; with QueryData do begin Close; SQL.Clear; SQL.Add(ASelectSQL); Open; end; ClientDataSetData.Open; ASelectSQL contains this SQL: SELECT TT_NIV_ID, TT_NIV, REPLACE(TT_NIV_NAME, '|', '!') as TT_NIV_NAME2 FROM TT_SYS_PRJ_NIV The ClientDataSetData.Open gives an insufficient memory error on a dataset with 42200 records. If I inspect the result data (in the

PHP append to ClientDataSet CDS File

核能气质少年 提交于 2019-12-22 08:37:33
问题 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, Phone:18001234567} 2: {Name:Jack, Phone:18009876543} 3: {Name:Sparrow, Phone:18887892345} } I've selected PHP because I'm proficient with the language and my web server is a shared-linux host. Basically I cannot run Delphi here. I'm open to other options that

I need to avoid attempting to update non-physical fields in a Delphi TClientDataset connected to a TSQLQuery

爱⌒轻易说出口 提交于 2019-12-22 04:12:46
问题 Precis: My code is attempting to update non-physical fields in a Delphi XE TClientDataset , (connected to a TSQLQuery with its SQL property set) that were created as result of a runtime Open command. I have a TClientDataset connected to a TDatasetProvider connected to a TSQLQuery connected to a TSQLConnection . The first 3 of these objects are encapsulated within a couple of classes in a library that I use in many places on several projects. These classes create these 3 objects at runtime and

TClientDataSet Doesn't Release Memory

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 22:37:26
问题 I have a DataSnap server that creates a TSQLQuery, TDataSetProvider and a TClientDataSet that are unique to a given user's session, which are used and reused to retrieve data from a database and send TClientDataSet.Data (an OleVariant) to the client. It works very well, except for one problem. When I populate the TClientDataSet by calling its Open method, the memory that is allocated is not freed until the user disconnects their client from the DataSnap server. As the user uses the

Delphi - Is TClientDataset Thread Safe?

拟墨画扇 提交于 2019-12-18 15:49:10
问题 I have a TClientDataset that is managed in Thread 1. In a different thread I have a cloned Image of the TClientDataset. Will I run into threading problems? Edit The cloned image is used in a read only mode. 回答1: The short answer is no, a ClientDataSet is not thread safe. The more involved answer is that it depends on how you use it. No matter how many clones of the ClientDataSet you have, they are safe to use from multiple threads so long as you are only reading the data. This is true even if

How to use the Filter functions of TClientdatasets for dates?

六月ゝ 毕业季﹏ 提交于 2019-12-13 06:29:09
问题 I have a TClientDataSet in Delphi 7 and I'd like to apply a filter which I type into a simple TEdit, so it looks like this: CDS.Filter:=Edit1.Text; CDS.Filtered:=True; Now I looked at the Helpfile for filtering records and according to it I should be able to Filter DateTime-Fields as well. But whenever I write something like this into my Edit: DAY(EDATUM)=17 and apply the filter I get a "Type Mismatch in Expression"-Exception. I have tried numerous different formats of the example above. DATE

How to avoid “Type mismatch in expression” in ClientDataSet Filter

随声附和 提交于 2019-12-13 04:24:11
问题 The erro msg "Type mismatch in expression" appear when I run this code: CDSIndicados.Filtered := False; CDSIndicados.Filter := 'EDICOES_ID like ' + QuotedStr(IntToStr(Integer(cxComboBox1.Properties.Items.Objects[cxComboBox1.ItemIndex]))); CDSIndicados.Filtered := True; I know this message may appear when there is an error in the data type of the field. But I could not fix. Was that it? 回答1: I'm suspecting that your EDICOES_ID field is an integer value, in which case you don't need to quote it

How I get the new Field Value from a TClientDataset in Delphi?

萝らか妹 提交于 2019-12-13 02:09:42
问题 hi i have a problem with TClientDataset in Delphi. I want to get a Dataset with the changed Data. here is my code: procedure TForm2.btnUpdateClick(Sender: TObject); var I: Integer; counter : Integer; //for testing value : String; begin if not Self.DatasetArtikel.Active then begin ShowMessage('Nicht aktiv'); Exit; end; if Self.DatasetArtikel.ChangeCount = 0 then begin ShowMessage('Delta is empty'); Exit; end; counter := DatasetArtikel.ChangeCount; //DatasetArtikelUpdate.ClearFields; /