📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "“家财管理”登录"
ClientHeight = 1485
ClientLeft = 45
ClientTop = 330
ClientWidth = 3690
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1485
ScaleWidth = 3690
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
WhatsThisButton = -1 'True
WhatsThisHelp = -1 'True
Begin VB.ComboBox cboName
Height = 300
Left = 720
Style = 2 'Dropdown List
TabIndex = 5
Top = 120
Width = 2895
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 360
Left = 2040
TabIndex = 3
Tag = "取消"
Top = 960
Width = 1140
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 360
Left = 720
TabIndex = 2
Tag = "确定"
Top = 960
Width = 1140
End
Begin VB.TextBox txtPassword
Height = 270
IMEMode = 3 'DISABLE
Left = 720
PasswordChar = "*"
TabIndex = 1
Top = 480
Width = 2895
End
Begin VB.Label lblLabels
Caption = "密码:"
Height = 255
Index = 1
Left = 105
TabIndex = 0
Tag = "密码(&P):"
Top = 540
Width = 690
End
Begin VB.Label lblLabels
AutoSize = -1 'True
Caption = "姓名:"
Height = 180
Index = 0
Left = 105
TabIndex = 4
Tag = "用户名称(&U):"
Top = 150
Width = 540
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public gblnOK As Boolean
Private Sub cmdCancel_Click()
gblnOK = False
Hide
End Sub
Private Sub cmdOK_Click()
On Error Resume Next
Dim strName As String
Dim strKL As String
Dim rs As ADODB.Recordset
strName = Trim(cboName.Text)
strKL = Trim(txtPassword)
DbeJcgl.CYDL strName, strKL
Set rs = DbeJcgl.rsCYDL
'验证用户
If rs.EOF Then
MsgBox "密码错误,再试一次!", , "登录"
txtPassword.SetFocus
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
Else
gblnOK = True
gblQx = rs("管理权")
If gblQx Then
gstrName = "%"
Else
gstrName = strName
End If
Hide
End If
rs.Close
Set rs = Nothing '释放对象
End Sub
Private Sub Form_Load()
On Error Resume Next
Dim rs As ADODB.Recordset
'取得家庭成员登录清单
DbeJcgl.rsCYDLQD.Open
Set rs = DbeJcgl.rsCYDLQD
Do Until rs.EOF
cboName.AddItem rs("姓名")
rs.MoveNext
Loop
rs.Close
Set rs = Nothing '释放对象
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -