tclientdataset

Reverse the order on an index for a ClientDataSet

老子叫甜甜 提交于 2019-12-12 10:49:48
问题 I'm wanting to reverse the order of an index in a TClientDataSet, the following code looks like it should do the trick but does nothing. Is there a nice way to reverse the order of an index? procedure TForm8.Button1Click(Sender: TObject); var index: TIndexDef; begin index := ClientDataSet1.IndexDefs.Find('LengthIndex'); if ixDescending in index.Options then index.Options := index.Options - [ixDescending] else index.Options := index.Options + [ixDescending]; end; 回答1: TIndexDef.Options are

Cannot assign data to client dataset

时光毁灭记忆、已成空白 提交于 2019-12-12 05:27:01
问题 I'm using TClientDataSet assigned with local data in my Delphi application to compare data between 2 tables located in 2 different databases. Things I'm using: SpPlansQuery: TADOQuery – original data query PPUQuery: TADOQuery – changed data query (uses different ADO connection than SpPlansQuery) ComparisonDataSet: TClientDataSet – dataset showing only differences between 2 previous queries I'm trying to fill ComparisonDataSet as follows (I heavily reduced my code to highlight problem):

ClientDataSet TBCDField rounding

左心房为你撑大大i 提交于 2019-12-11 19:48:19
问题 I'm using Delphi 5 + BDE + Oracle. I have the following function: class function TClientDataSetFactory.GetClientDataSet( const qryGen: TDataSet): TClientDataSet; var dspDados: TDataSetProvider; begin Result := nil; try try Result := TClientDataSet.Create(nil); dspDados := TDataSetProvider.Create(Result); dspDados.DataSet := qryGen; qryGen.Active := True; qryGen.First; Result.Data := dspDados.Data; Result.First; except on E: Exception do begin raise; end; end; finally end; end; so, when a run

Delphi TClientDataSet Filtering using LIKE and foCaseInsensitive

荒凉一梦 提交于 2019-12-11 03:38:45
问题 Using Delphi XE, I'm trying to do some filtering on a TClientDataSet and I'm unable to get the case-insensitive filtering to work properly in conjunction with a LIKE operator Consider this code which does the filtering cdsDocs.DisableControls; try cdsDocs.Filtered := False; cdsDocs.FilterOptions := [foCaseInsensitive]; cdsDocs.Filter := 'Product LIKE ''%' + txtFilter.Text + '%'''; cdsDocs.Filtered := True; finally cdsDocs.EnableControls; end; and consider that the Product field of this

How can a TClientDataSet determine what type of database it is (remotely) connected to?

懵懂的女人 提交于 2019-12-11 02:36:50
问题 Under FireDAC, I have a TFDConnection -> TFDQuery -> TDataSetProvider in a server app and a TClientDataSet in a client app. They are connected through the RemObjects Remoting SDK. (The TClientDataSet.RemoteServer is set to a TRODataSnapConnection ). The TFDConnection may be connected to different database types. With the TClientDataSet code in the client, (how) can I determine the database type? For a simple app containing all these components I could scan the datamodule for a component of

TClientDataset ApplyUpdates error because of database table constraint

走远了吗. 提交于 2019-12-10 19:28:55
问题 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 reasons. The problem is that, sometimes, in this bunch of records lies one that will trigger database constraint; Delphi fires an exception on ApplyUpdates . My problem is I don't know which record is responsible for this exception. There are 500

How to read a .cds database (TClientDataSet) with .Net

烈酒焚心 提交于 2019-12-10 17:49:16
问题 I have an old databasefile from an application written in Delphi. My task is to extract the data, and move it to an SQL-Database. I know it is in .cds format which uses the TClientDataSet-Class from Delphi. The problem is: I have no Delphi, no documentation and the guy who has written the app left the company years ago. So, my question is: Is there any way (besides Delphi or text-parsing) to access the data with Dot.net, Python, Ruby, Java or Perl? A simple "export" to XML or CSV would work

to track the modified rows and manually update from the TClientDataSet's Delta

邮差的信 提交于 2019-12-10 15:23:54
问题 Is there any way to manually track the changes done to a clientdataset's delta and update the changes manually on to then db. i have dynamically created a clientdataset and with out a provider i am able to load it with a tquery, now user will do some insert update and delete operations on the data available in the cds, and at final stage these data(modified) should be post in to database by using a tquery(not apply updates).. 回答1: After populating your data set from the TQuery call

Check if row was changed in a TClientDataset

倾然丶 夕夏残阳落幕 提交于 2019-12-10 14:22:12
问题 I have a TClientDataset with n fields and I have to loop through them to count how many have changed but doing: if (Cds.fields1.Value <> Cds.fields1.OldValue) and (Cds.fields2.Value <> Cds.fields2.OldValue) etc.... or looping through Cds.fields[I] is not very 'clean' Is there a Cds.RowChanged method or something? 回答1: You can use the TClientDataSet's UpdateStatus property for this: if Cds.UpdateStatus = usModified then // current row was changed Other possible values are usUnmodified ,

How to sort a ClientDataSet on a calculated field?

独自空忆成欢 提交于 2019-12-10 09:56:28
问题 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 = 'Highlight'; IndexDefs[0].Fields = 'Highlight;PatNo'; IndexDefs[0].Name = 'PatNo'; IndexDefs[0].Options = [ixDescending]; and obviously I have set my client dataset's IndexName to 'PatNo' . When I run my application, the data in the CDS is sorted on