G
gdtkd
Unregistered / Unconfirmed
GUEST, unregistred user!
有主窗体Form1,有子窗体Form2,通过点击Form1的DBGRid时以Showmodal的形式弹出修改子窗体Form2进行数据修改,但当Form2完成数据修改后,要刷新Form1的DBGrid时,就出现以下错误:
BLFrm [地区资料设置] -> DBGridEh1 -> Access violation at address 00505238 in module 'NwMIS.exe'. Read of address 00000324
代码如下
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Text:=' Update BaseInfoTb Set S1_Name = '''+Caption+''', S1_Value1 = '''+Trim(Edit2.Text)+''', S1_IsValid = '+CheckStr+' Where S1_ID = '+IntToStr(RecID)+'';
ADOQuery1.ExecSQL;
ADOQuery1.Close;
//BLFrm.DBGridEh1.Close;
//BLFrm.ADOQuery1.Open;
MessageDlg('系统信息:修改数据成功!', mtInformation, [mbOK], 0);
Close;
BLFrm [地区资料设置] -> DBGridEh1 -> Access violation at address 00505238 in module 'NwMIS.exe'. Read of address 00000324
代码如下
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Text:=' Update BaseInfoTb Set S1_Name = '''+Caption+''', S1_Value1 = '''+Trim(Edit2.Text)+''', S1_IsValid = '+CheckStr+' Where S1_ID = '+IntToStr(RecID)+'';
ADOQuery1.ExecSQL;
ADOQuery1.Close;
//BLFrm.DBGridEh1.Close;
//BLFrm.ADOQuery1.Open;
MessageDlg('系统信息:修改数据成功!', mtInformation, [mbOK], 0);
Close;