对话框提醒"无该用户!"
设置了访问权限,根据不同人的管理职能提供相应的管理权限 它的具体代码为:
Private Sub Command1_Click()
Adodc1.RecordSource = "select * from 用户登陆 where 用户名='" & Trim(Text1.Text) & "'" Adodc1.Refresh
If Trim(Text1.Text) = "" Then
MsgBox "用户名不能为空!", vbOKOnly + vbExclamation, "警告!"
Text1.SetFocus Exit Sub End If
If Adodc1.Recordset.EOF Then
MsgBox "用户名不存在,请重新输入!", vbOKOnly + vbExclamation, "警告!" Text1.Text = "" Text1.SetFocus Exit Sub Else
If Text2.Text <> Adodc1.Recordset.Fields("密码") Then
MsgBox "密码错误!", vbOKOnly + vbExclamation, "警告! Text2.Text = "" Text2.SetFocus Exit Sub End If End If
If Combo1.Text <> Adodc1.Recordset.Fields("身份") Then
MsgBox "权限错误!", vbOKOnly + vbExclamation, "警告!"Else
If Combo1.Text = "管理员" Then MsgBox "成功登陆" Form2.Show 0.1 Form1.Hide
Else: Form30.Show 0.1 Form1.Hide End If End If End Sub
Private Sub Command2_Click()