移动实名认证免认证:用VB设计密码登陆

来源:百度文库 编辑:神马品牌网 时间:2024/05/09 07:05:58
有一个程序不知怎么就是运行不了真繁死我了,懂得朋友给看看
Private Sub Command1_Click()
If DBCombo1.Text = "" Then
MsgBox "你输入用户名称!", 0 + 48, "登录失败"
DBCombo1.SetFocus
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "请输入密码!", 0 + 48, "登录失败"
Text2.SetFocus
SendKeys "{home}+{end}"
Exit Sub
End If

UserN = DBCombo1.Text
UserP = Text2.Text

'检查是否是注册用户
Data1.RecordSource = "Select * From user Where UserName='" & UserN & "' "
' Data1.Refresh
If Data1.Recordset.BOF And Data1.Recordset.EOF Then
MsgBox "对不起,此用户不是注册用户,请先注册!", 0 + 16, "登录失败"
Text1.SetFocus
SendKeys "{home}+{end}"
Exit Sub
Else
If UserP <> Data1.Recordset.Fields("UserPSW") Then
MsgBox "对不起,你输入的密码无效,请重输!", 0 + 16, "登录失败"
Text2.SetFocus
SendKeys "{home}+{end}"
Exit Sub
End If
End If

'登录成功
Unload Me
Load frmTest
frmTest.Show 1
End Sub

'登录成功
Load frmTest
frmTest.Show 1
Unload Me
End Sub

试试行不