Dim j as single 中j的作用
Private Sub Cmd_OK_Click() Conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "尀Device.mdb;Persist Security Info=False" Dim j As Single✀数据有效性检查 If txtUser = "" Then MsgBox "请输入用户名" txtUser.SetFocus Exit Sub End If If txtPwd = "" Then MsgBox "请输入密码" txtPwd.SetFocus Exit Sub End If ✀将用户输入赋值到变量中 NameKey = MakeStr(txtUser) PasswordKey = MakeStr(txtPwd) ✀判断用户是否存在 If MyUser.In_DB(NameKey) = False Then MsgBox "用户名不存在" Try_times = Try_times + 1 If Try_times >= 3 Then MsgBox "您已经三次尝试进入本系统,均不成功,系统将关闭" DBapi_Disconnect End Else Exit Sub End If End If✀判断密码是否正确 MyUser.GetInfo (NameKey) If MyUser.UserPwd <> PasswordKey Then MsgBox "密码错误" Try_times = Try_times + 1 If Try_times >= 3 Then MsgBox "您已经三次尝试进入本系统,均不成功,系统将关闭" DBapi_Disconnect End Else Exit Sub End If End If ✀登录成功,将当前用户的信息保存在CurUser中 CurUser.GetInfo (MyUser.UserName)✀关闭登录对话框 Unload MeEnd Sub