9
998169
Unregistered / Unconfirmed
GUEST, unregistred user!
[^][^]
[^]两台客户机 在同时运行同一个模块时,不能同时存盘,只有一台计机存盘成功
另一台机输入的信息丢失. 出现的错误信息如下:
A dead lock was detected ,your transaction(Process Id #29) was deadlocked
with another process and has been chosen as the deadlock victim. Return
your gerneral SOL error transaction.
请各位高手指教。以下代码错误在哪里
致谢!
我的系统配置:前台: win98 +delphi5.0 开发的应用程序
后台:winnt4.0 +SOL server 7.0
模块代码如下:
procedure TfrmDhjt.SaveBtnClick(Sender: TObject);
var
I, J, K: Integer;
s4, q1, q2, q3:String;
begin
dmHui.PostFrom:= pfDhjt;
case TADB_Dhjt of
ad_Dhjt_other:
begin
MessageBox(Handle, '未记录问题的各项资料!', '提示', MB_OK + MB_ICONWARNING)
end;
ad_Dhjt_Question:
begin
MessageBox(Handle, '未记录客户的各项资料!', '提示', MB_OK + MB_ICONWARNING)
end;
ad_Dhjt_Both:
begin
if not dmHui.dbHui.InTransaction then
dmHui.dbHui.StartTransaction;
try
{Append khzl}
q1:=edit1.Text;
q2:=edit2.Text;
q3:=edit3.Text;
dmhui.tbkhzlebsc.AsString:=dbmemo2.Text;
dmhui.tbkhzljmz.AsString:=dbmemo3.Text;
dmHui.tbkhzl.Post;
{Append dhjt}
dmhui.tbkhzl.Filtered:= False;
dmhui.tbkhzl.Filter:='xm = '+#39+q1+#39+' and qh = '+#39+q2+#39+' and hm = '+#39+q3+#39;
dmHui.tbJtdhkhh.AsInteger:= dmHui.tbkhzlkhh.AsInteger;
dmhui.tbkhzl.Filtered:= True;
dmHui.tbJtdhkhh.AsInteger:= dmHui.tbkhzlkhh.AsInteger;
dmHui.tbJtdh.FieldByName('jssj').AsDateTime:= Now;
dmHui.tbJtdh.FieldByName('jlydm').AsString:= frmLogin.sysUser;
dmHui.tbJtdh.Post;
// dmhui.tbkhzl.Post;
{Append dhcxwt}
dmHui.tbJtdh.First;
dmHui.tbJtdh.Last;
for I:= 0 to CheckListBox1.Items.Count -1 do
begin
if CheckListBox1.Checked then
begin
dmHui.tbDhcxwt.Append;
dmHui.tbDhcxwt.FieldByName('bh').AsInteger:= dmHui.tbJtdh.FieldByName('jtdhbh').AsInteger;
dmHui.tbDhcxwt.FieldByName('zxwt').AsString:= CheckListBox1.Items.Strings;
dmHui.tbDhcxwt.FieldByName('wtdm').AsString:= AnswerCodeList.Strings[0];
s4:= AnswerBm.Text;
dmHui.tbZrbm.Filtered:=false;
dmHui.tbZrbm.Filter:='bm = '+#39+s4+#39;
dmHui.tbZrbm.filtered:=true;
if not dmhui.tbZrbm.IsEmpty then
dmHui.tbdhcxwtzrbmbh.Value:=dmHui.tbZrbmbmbh.Value;
dmHui.tbDhcxwt.FieldByName('zdyda').AsString:= AnswerList.Text;
dmHui.tbDhcxwt.Post;
end
else {Unreply do with}
begin
case MessageBox(Handle, '存在未定义问题。是否将问题打印?按取消按钮取消操作', '提示', MB_YESNOCANCEL + MB_ICONWARNING) of
IDYES: begin
dmHui.tbDhcxwt.Append;
dmHui.tbDhcxwt.FieldByName('bh').AsInteger:= dmHui.tbJtdh.FieldByName('jtdhbh').AsInteger;
dmHui.tbDhcxwt.FieldByName('zxwt').AsString:= CheckListBox1.Items.Strings;
dmHui.tbDhcxwt.FieldByName('sfdy').AsString:= '1';
dmHui.tbDhcxwt.Post;
end;
IDNO: begin
dmHui.tbDhcxwt.Append;
dmHui.tbDhcxwt.FieldByName('bh').AsInteger:= dmHui.tbJtdh.FieldByName('jtdhbh').AsInteger;
dmHui.tbDhcxwt.FieldByName('sfdy').AsString:= '';
dmHui.tbDhcxwt.FieldByName('zxwt').AsString:= CheckListBox1.Items.Strings;
dmHui.tbDhcxwt.Post;
end;
IDCANCEL: begin
dmHui.dbHui.Rollback;
Exit;
end;
end;
end;
end;
for J:= 0 to CheckListBox1.Items.Count -1 do
begin
StanQuesList[J].Clear;
AnswerList[J].Clear;
AnswerCodeList[J].Clear;
AnswerBM[J].Clear;
end;
{Append hxhmtj}
// dmHui.DelQuery.Close;
// dmHui.DelQuery.SQL.Clear;
// dmHui.DelQuery.SQL.Add('Delete from Hxhmtj where khh = ' +dmHui.tbKhzl.FieldByName('khh').AsString);
// dmHui.DelQuery.ExecSQL;
for K:= 0 to CheckListBox2.Items.Count -1 do
begin
if CheckListBox2.Checked[K] then
begin
if CheckListBox2.Items.Strings[K] <> '其他' then
begin
if dmHui.tbHshmtj.Locate('tj', CheckListBox2.Items.Strings[K], [loCaseInsensitive]) then
begin
dmHui.tbHxhmtj.Append;
dmHui.tbHxhmtj.FieldByName('khh').AsInteger:= dmHui.tbkhzl.FieldByName('khh').AsInteger;
dmHui.tbHxhmtj.FieldByName('hmbh').AsInteger:= dmHui.tbHshmtjhmtj.AsInteger;
dmHui.tbHxhmtj.Post;
end;
end;
end;
end;
for I:= 0 to CheckListBox2.Items.Count -1 do
begin
CheckListBox2.Checked:= False;
end;
{Append hxcptj}
// dmHui.DelQuery.Close;
// dmHui.DelQuery.SQL.Clear;
// dmHui.DelQuery.SQL.Add('Delete from Hxcptj where khh = ' +dmHui.tbKhzl.FieldByName('khh').AsString);
// dmHui.DelQuery.ExecSQL;
for K:= 0 to CheckListBox3.Items.Count -1 do
begin
if CheckListBox3.Checked[K] then
begin
if CheckListBox3.Items.Strings[K] <> '其他' then
begin
if dmHui.tbHscptj.Locate('tj', CheckListBox3.Items.Strings[K], [loCaseInsensitive]) then
begin
dmHui.tbHxcptj.Append;
dmHui.tbHxcptj.FieldByName('khh').AsInteger:= dmHui.tbkhzl.FieldByName('khh').AsInteger;
dmHui.tbHxcptj.FieldByName('hmbh').AsInteger:= dmHui.tbHscptjtjbh.AsInteger;
dmHui.tbHxcptj.Post;
end;
end;
end;
end;
for I:= 0 to CheckListBox3.Items.Count -1 do
begin
CheckListBox3.Checked:= False;
end;
dmHui.dbHui.Commit;
{Initialize}
CheckListBox1.Items.Clear;
checkbox1.Checked:=false;
checkbox2.Checked:=false;
checkbox3.Checked:=false;
checkbox4.Checked:=false;
checkbox5.Checked:=false;
checkbox6.Checked:=false;
memo6.Lines.Clear;
Panel1.Enabled:= True;
pcData.Enabled:= False;
ListBox1.Items.Clear;
Memo1.Lines.Clear;
dbmemo2.text:='';
dbmemo3.text:='';
edit6.Text:='';
edit7.Text:='';
TADB_Dhjt:= ad_Dhjt_None;
except
dmHui.dbHui.Rollback;
end;
end;
end;
end;
代码:
另一台机输入的信息丢失. 出现的错误信息如下:
A dead lock was detected ,your transaction(Process Id #29) was deadlocked
with another process and has been chosen as the deadlock victim. Return
your gerneral SOL error transaction.
请各位高手指教。以下代码错误在哪里
致谢!
我的系统配置:前台: win98 +delphi5.0 开发的应用程序
后台:winnt4.0 +SOL server 7.0
模块代码如下:
procedure TfrmDhjt.SaveBtnClick(Sender: TObject);
var
I, J, K: Integer;
s4, q1, q2, q3:String;
begin
dmHui.PostFrom:= pfDhjt;
case TADB_Dhjt of
ad_Dhjt_other:
begin
MessageBox(Handle, '未记录问题的各项资料!', '提示', MB_OK + MB_ICONWARNING)
end;
ad_Dhjt_Question:
begin
MessageBox(Handle, '未记录客户的各项资料!', '提示', MB_OK + MB_ICONWARNING)
end;
ad_Dhjt_Both:
begin
if not dmHui.dbHui.InTransaction then
dmHui.dbHui.StartTransaction;
try
{Append khzl}
q1:=edit1.Text;
q2:=edit2.Text;
q3:=edit3.Text;
dmhui.tbkhzlebsc.AsString:=dbmemo2.Text;
dmhui.tbkhzljmz.AsString:=dbmemo3.Text;
dmHui.tbkhzl.Post;
{Append dhjt}
dmhui.tbkhzl.Filtered:= False;
dmhui.tbkhzl.Filter:='xm = '+#39+q1+#39+' and qh = '+#39+q2+#39+' and hm = '+#39+q3+#39;
dmHui.tbJtdhkhh.AsInteger:= dmHui.tbkhzlkhh.AsInteger;
dmhui.tbkhzl.Filtered:= True;
dmHui.tbJtdhkhh.AsInteger:= dmHui.tbkhzlkhh.AsInteger;
dmHui.tbJtdh.FieldByName('jssj').AsDateTime:= Now;
dmHui.tbJtdh.FieldByName('jlydm').AsString:= frmLogin.sysUser;
dmHui.tbJtdh.Post;
// dmhui.tbkhzl.Post;
{Append dhcxwt}
dmHui.tbJtdh.First;
dmHui.tbJtdh.Last;
for I:= 0 to CheckListBox1.Items.Count -1 do
begin
if CheckListBox1.Checked then
begin
dmHui.tbDhcxwt.Append;
dmHui.tbDhcxwt.FieldByName('bh').AsInteger:= dmHui.tbJtdh.FieldByName('jtdhbh').AsInteger;
dmHui.tbDhcxwt.FieldByName('zxwt').AsString:= CheckListBox1.Items.Strings;
dmHui.tbDhcxwt.FieldByName('wtdm').AsString:= AnswerCodeList.Strings[0];
s4:= AnswerBm.Text;
dmHui.tbZrbm.Filtered:=false;
dmHui.tbZrbm.Filter:='bm = '+#39+s4+#39;
dmHui.tbZrbm.filtered:=true;
if not dmhui.tbZrbm.IsEmpty then
dmHui.tbdhcxwtzrbmbh.Value:=dmHui.tbZrbmbmbh.Value;
dmHui.tbDhcxwt.FieldByName('zdyda').AsString:= AnswerList.Text;
dmHui.tbDhcxwt.Post;
end
else {Unreply do with}
begin
case MessageBox(Handle, '存在未定义问题。是否将问题打印?按取消按钮取消操作', '提示', MB_YESNOCANCEL + MB_ICONWARNING) of
IDYES: begin
dmHui.tbDhcxwt.Append;
dmHui.tbDhcxwt.FieldByName('bh').AsInteger:= dmHui.tbJtdh.FieldByName('jtdhbh').AsInteger;
dmHui.tbDhcxwt.FieldByName('zxwt').AsString:= CheckListBox1.Items.Strings;
dmHui.tbDhcxwt.FieldByName('sfdy').AsString:= '1';
dmHui.tbDhcxwt.Post;
end;
IDNO: begin
dmHui.tbDhcxwt.Append;
dmHui.tbDhcxwt.FieldByName('bh').AsInteger:= dmHui.tbJtdh.FieldByName('jtdhbh').AsInteger;
dmHui.tbDhcxwt.FieldByName('sfdy').AsString:= '';
dmHui.tbDhcxwt.FieldByName('zxwt').AsString:= CheckListBox1.Items.Strings;
dmHui.tbDhcxwt.Post;
end;
IDCANCEL: begin
dmHui.dbHui.Rollback;
Exit;
end;
end;
end;
end;
for J:= 0 to CheckListBox1.Items.Count -1 do
begin
StanQuesList[J].Clear;
AnswerList[J].Clear;
AnswerCodeList[J].Clear;
AnswerBM[J].Clear;
end;
{Append hxhmtj}
// dmHui.DelQuery.Close;
// dmHui.DelQuery.SQL.Clear;
// dmHui.DelQuery.SQL.Add('Delete from Hxhmtj where khh = ' +dmHui.tbKhzl.FieldByName('khh').AsString);
// dmHui.DelQuery.ExecSQL;
for K:= 0 to CheckListBox2.Items.Count -1 do
begin
if CheckListBox2.Checked[K] then
begin
if CheckListBox2.Items.Strings[K] <> '其他' then
begin
if dmHui.tbHshmtj.Locate('tj', CheckListBox2.Items.Strings[K], [loCaseInsensitive]) then
begin
dmHui.tbHxhmtj.Append;
dmHui.tbHxhmtj.FieldByName('khh').AsInteger:= dmHui.tbkhzl.FieldByName('khh').AsInteger;
dmHui.tbHxhmtj.FieldByName('hmbh').AsInteger:= dmHui.tbHshmtjhmtj.AsInteger;
dmHui.tbHxhmtj.Post;
end;
end;
end;
end;
for I:= 0 to CheckListBox2.Items.Count -1 do
begin
CheckListBox2.Checked:= False;
end;
{Append hxcptj}
// dmHui.DelQuery.Close;
// dmHui.DelQuery.SQL.Clear;
// dmHui.DelQuery.SQL.Add('Delete from Hxcptj where khh = ' +dmHui.tbKhzl.FieldByName('khh').AsString);
// dmHui.DelQuery.ExecSQL;
for K:= 0 to CheckListBox3.Items.Count -1 do
begin
if CheckListBox3.Checked[K] then
begin
if CheckListBox3.Items.Strings[K] <> '其他' then
begin
if dmHui.tbHscptj.Locate('tj', CheckListBox3.Items.Strings[K], [loCaseInsensitive]) then
begin
dmHui.tbHxcptj.Append;
dmHui.tbHxcptj.FieldByName('khh').AsInteger:= dmHui.tbkhzl.FieldByName('khh').AsInteger;
dmHui.tbHxcptj.FieldByName('hmbh').AsInteger:= dmHui.tbHscptjtjbh.AsInteger;
dmHui.tbHxcptj.Post;
end;
end;
end;
end;
for I:= 0 to CheckListBox3.Items.Count -1 do
begin
CheckListBox3.Checked:= False;
end;
dmHui.dbHui.Commit;
{Initialize}
CheckListBox1.Items.Clear;
checkbox1.Checked:=false;
checkbox2.Checked:=false;
checkbox3.Checked:=false;
checkbox4.Checked:=false;
checkbox5.Checked:=false;
checkbox6.Checked:=false;
memo6.Lines.Clear;
Panel1.Enabled:= True;
pcData.Enabled:= False;
ListBox1.Items.Clear;
Memo1.Lines.Clear;
dbmemo2.text:='';
dbmemo3.text:='';
edit6.Text:='';
edit7.Text:='';
TADB_Dhjt:= ad_Dhjt_None;
except
dmHui.dbHui.Rollback;
end;
end;
end;
end;