📄 userlogin.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "UserLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Dim con As Connection
Dim rst As Recordset
Public Function UserLogin(ManageID As String, password As String) As Boolean
Set con = New Connection
With con
.Provider = "SQLOLEDB"
.ConnectionString = "user id=sa;password=;data source =QIANJI; initial catalog=movie"
.Open
End With
Set rst = New Recordset
rst.Open "select cPassword from manager where cManageID='" & Trim(Text1) & "'", con, adOpenDynamic, adLockBatchOptimistic
Dim bl As Boolean
If rst.EOF = True Then
MsgBox "该用户不存在!", vbExclamation, "错误提示"
Exit Function
Else
If rst(0) = password Then
MsgBox "验证成功!", vbInformation, "信息提示"
bl = True
Else
MsgBox "密码错误!", vbExclamation, "错误提示"
Exit Function
End If
End If
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -