一楼的这种判断似乎用ExecuteScalar直接返回值更合理些,如:
Dim cmd As New SQLCommandcmd.CommandText = "Select Count(姓名) From {员工信息库} Where [姓名] = '" & User.Name & "'"If cmd.ExecuteScalar() = 0 Then MessageBox.show("此账户已停用!")End If