If User.Roles = "实习生" Then
MessageBox.Show("实习生无权查看业务详情!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Dim cmd As New SQLCommand
cmd.C
Dim exp As String = "当前编辑 Is Null And [_Identify] = " & e.Row("_Identify")
cmd.CommandText = "Update {业务表} Set 当前编辑 = '" & User_Name & "' Where " & exp
If cmd.ExecuteNonQuery = 1 Then '修改行数
e.Row("当前编辑") = User_Name
e.Row.Save()
Forms("业务信息窗口").Open
Else
cmd.CommandText = "Select 当前编辑 From {业务表} Where [_Identify] = " & e.Row("_Identify")
Dim nm As String = cmd.ExecuteScalar
If nm > "" Then
MessageBox.show(nm & "正在编辑此行!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
MessageBox.show("此行可能已经被删除,无法编辑!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
End If
End If
为什么实际运行过程中,有的业务记录会提示此行可能已经被删除,无法编辑!,而有的又正常呢?