Delphi: using TClientDataset as an in-memory dataset

前端 未结 11 2255
无人及你
无人及你 2020-12-14 08:00

According to this page, it\'s possible to use TClientDataset as an in-memory dataset, completely independent of any actual databases or files. It describes how

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-14 08:48

    The code from this page doesn't work in ANY Delphi version. A call to CreateDataSet already puts the dataset into active state ("opened"). You should use .CreateDataSet OR .Open. Not both.

    Use .Open when you want to fetch data from a Provider (via ProviderName property) and .CreateDataSet when you want to populate the Dataset by yourself.

    BTW: For an in depth reference about ClientDataSets and its features take a look on excellent Cary Jensen articles on CodeGear Developer Network (read the oldest ones, first)

提交回复
热议问题