Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh data in ClientDataSet?

Status
Not open for further replies.

corsair2

IS-IT--Management
Feb 21, 2001
55
GB
I have an OracleDatSet component (downloaded as part of a suite from ) which provides the link to our Oracle database (v8.1.7.0) for a DataSetProvider which connects to a ClientDataSet.
This set-up works fine when a report is first run but when the parameters for the OracleDataSet are changed and the report is re-run the changes in the data held in the OracleDataSet are not being reflected in the ClientDataSet.
I had, perhaps naively, assumed that any changes in the source dataset would be automatically refelected in the clientdataset - not so.
Has anyone got an idea how I can refresh the ClientDataSet 'passively' - ie. without sending anything back to the DataSetProvider or OracleDataSet?

Regards

Steve
 
Hi,

ClientDataSets contain their own in-memory copy of the data. That is the joy of them, that data can be read and changed without continual reference to the underlying database. Then changes can be updated back or not as you please.

When opening a CDS / Provider / DBDataset trio, it is normall to call "Open" on the CDS, not the DBDataset. The DBDataset will be opened automatically. You can also set the DBDataset parameters from the CDS. Use code like this:

proc ClientDataSet1BEforeOpen(ADataset:TDataset);
ClientDataSet1.FetchParams;
ClientDatsSet1.ParamByName('KeyID').asInteger:=59;

Do you get the drift? The point is, at run time, you don't need to go near the DBDataset.

Also check out:
TClientDataSet.Refresh; (Never use it personally, but it might do what you want)
TDataset.option; (Will not solve your current problem but will enlighten you as to what CDS can do.)

How to use CDS info is scant in the help, but there are some good white papers on the Borland site.

Good luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top