[design time]ClientDataSet.CreateDataSet error - Invalid Field Type :
(solution: restart Delphi)
-------------------------------
Can not use TDateSet.Locate to locate DateTime Field
-------------------------------
PlanNo is the linked field of cdsMaster and cdsDetail.
cdsDetailOnNewRecord(DataSet: TDataSet)
begin
cdsDetail.FindField('PlanNo').Value := cdsMaster.FindField('PlanNo').Value;
end;
once you add some record in cdsMaster, cdsDetail, you can not modify the linked field: PlanNo,
or Delphi will raise the Error: "Cascade update not enabled"
-------------------------------
Dont loop a DataSet in AfterPost,AfterDelete
-------------------------------
-- cdsMaster and cdsDetail is created by calling CreateDataSet. no provider.
the link between the two is manually setup via datasource and choose link field
if I invoke DisableControls on the cdsMaster and cdsDetail and when I scroll cdsMaster, the
cdsDetail will not step follow!!!!!!!!!!!!!!
//cdsMaster.DisableControls;
//cdsDetail.DisableControls;
try
cdsMaster.First;
while not cdsMaster.Eof do
begin
cdsDetail.First;
while not cdsDetail.Eof do
begin
.........
cdsDetail.Next;
end;
cdsMaster.Next;
end;
finally
//cdsMaster.EnableControls;
//cdsDetail.EnableControls;
end;
本文档解决 Delphi 中使用 ClientDataSet 创建数据集时遇到的问题,包括字段类型错误、定位日期时间字段失败、级联更新禁用及数据集循环等问题,并提供相应解决方案。

196

被折叠的 条评论
为什么被折叠?



