SDAC缓存主从表更新问题----急!!!----在线等!(100分)

  • 主题发起人 主题发起人 saith
  • 开始时间 开始时间
S

saith

Unregistered / Unconfirmed
GUEST, unregistred user!
谁来帮忙解决,保存主从表之前需要进行主关键字的修改,从表需要循环修改关键字,出现错误. 代码如下:<br>&nbsp; &nbsp; //---更新从表<br>&nbsp; &nbsp; First;<br>&nbsp; &nbsp; while not Eof do<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; if LowerCase(Trim(FieldByName(dbedt_SubMainKey.DataField).AsString)) &lt;&gt; LowerCase(Trim(Bill_Number)) then<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; EditDataSet(dbedt_SubMainKey.DataSource.DataSet);<br>&nbsp; &nbsp; &nbsp; &nbsp; FieldByName(dbedt_SubMainKey.DataField).AsString:= Bill_Number;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; Next;<br>&nbsp; &nbsp; end;<br>-------------------------------------<br>&nbsp;with dbedt_MainKey.DataSource.DataSet do<br>&nbsp; begin<br>&nbsp; &nbsp; EditDataSet(dbedt_MainKey.DataSource.DataSet);<br>&nbsp; &nbsp; if glb_DataSet.FieldByName('Main_IsNew').AsBoolean then<br>&nbsp; &nbsp; &nbsp; dbedt_MainKey.Field.AsString:= Bill_Number;<br>&nbsp; end;<br><br>----<br>错误提示:Can not use Master/Detail with CachedUpdates (D:/Projects/Delphi/Dac/Source/DBAccess.pas, line 3195)<br>执行到 First是就会出现此错误提示
 
没人回答,我的分都给不出去,呵呵
 
版本问题...
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
594
import
I
S
回复
0
查看
928
SUNSTONE的Delphi笔记
S
后退
顶部