Coverting a TMyQuery dataset to TClientDataSet in Delphi

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
CFaiga
Posts: 14
Joined: Sun 12 Feb 2006 09:28

Coverting a TMyQuery dataset to TClientDataSet in Delphi

Post by CFaiga » Wed 14 Jan 2009 16:37

Hi I make use of the Mydac components by devart (corelab) to access MySql from Delphi (2006) Very often I need to work with data in a TClientDataSet What is the best way to convert the dataset of a TMyQuery to TClientDataSet

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 16 Jan 2009 13:19

You can connect TClientDataSet to TMyQuery through the TDataSetProvider component.

CFaiga
Posts: 14
Joined: Sun 12 Feb 2006 09:28

Post by CFaiga » Sat 17 Jan 2009 08:34

Please can you show me some sample code

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 19 Jan 2009 13:41

You can use the following code:

Code: Select all

DataSetProvider.DataSet := MyQuery;
ClientDataSet.ProviderName := DataSetProvider;
After this you can use TClientDataSet.

Post Reply