J
jake668
Unregistered / Unconfirmed
GUEST, unregistred user!
同时两条语句插入数据到两个表中,用了事务,为什么会偶尔出现,前面一条数据保存成功,后面一条数据没有保存,但没有错误信息提示呢.一个月只是偶尔出现一条数据有这样的问题语句如下:SqlText:=' Insert Bas_Employee (EmpCode,Empname,CertCardNo,Sex,DeptCode,JobCode' +' Values (' +QuotedStr(Trim(BEdt_Empcode.Text))+',' +QuotedStr(BEdt_EmpName.Text)+',' +QuotedStr(BEdt_CertCardNO.Text)+',' +QuotedStr(BEdt_Sex.Text)+',' +QuotedStr(BEdt_DeptCode.Text)+',' +QuotedStr(Cmbox_JobCode.Text)+')'; SQLText:=SQLText + 'Insert Bas_EmpPayInfo (EmpCode) Values (' +QuotedStr(Trim(BEdt_Empcode.Text))+')'; AdoQry_Tmp.close; AdoQry_Tmp.SQL.Text:=SQLText; DBconnect.BeginTrans; Try Adoqry_Tmp.ExecSQL; DBConnect.CommitTrans; Except DBConnect.RollbackTrans; DispInfo('数据保存出错,请检查!',1); Abort; End;