frmyhsz.frm

来自「企业工资管理系统的具体实现」· FRM 代码 · 共 159 行

FRM
159
字号
VERSION 5.00
Begin VB.Form frmyhmm 
   BackColor       =   &H00FFFFFF&
   Caption         =   "用户登录"
   ClientHeight    =   1950
   ClientLeft      =   4170
   ClientTop       =   3420
   ClientWidth     =   4680
   Icon            =   "frmyhsz.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   130
   ScaleMode       =   0  'User
   ScaleWidth      =   312
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   2325
      TabIndex        =   5
      Top             =   315
      Width           =   2280
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取  消"
      Height          =   375
      Left            =   2505
      TabIndex        =   4
      Top             =   1425
      Width           =   840
   End
   Begin VB.CommandButton Command1 
      BackColor       =   &H80000004&
      Caption         =   "确  定"
      Height          =   375
      Left            =   1440
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   1425
      Width           =   840
   End
   Begin VB.TextBox Text2 
      Height          =   345
      IMEMode         =   3  'DISABLE
      Left            =   2325
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   780
      Width           =   2280
   End
   Begin VB.Image Image1 
      Height          =   1155
      Left            =   0
      Picture         =   "frmyhsz.frx":030A
      Stretch         =   -1  'True
      Top             =   -15
      Width           =   1065
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFFFFF&
      Caption         =   "用户密码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00004080&
      Height          =   210
      Left            =   1215
      TabIndex        =   1
      Top             =   840
      Width           =   1140
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFFFFF&
      Caption         =   "用户名:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00004080&
      Height          =   210
      Left            =   1230
      TabIndex        =   0
      Top             =   345
      Width           =   915
   End
End
Attribute VB_Name = "frmyhmm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public ok As Boolean
Private Sub Command1_Click()
Call cmok
End Sub

Private Sub Command2_Click()
ok = False
Me.Hide
End Sub

Private Sub Form_Load()
Dim cnn As New ADODB.Recordset
With cnn
    .ActiveConnection = constr
    .CursorLocation = adUseClient
    .CursorType = adOpenDynamic
    .LockType = adLockBatchOptimistic
    .Open "select * from mmb "
    If Not (.EOF And .BOF) Then .MoveFirst
    Do While Not .EOF
        Combo1.AddItem .Fields("yhm").Value
        .MoveNext
    Loop
    .Close
End With
Set cnn = Nothing
Combo1.Text = Combo1.List(0)
Text2.Text = ""
End Sub
Sub cmok()
Dim cnn As New ADODB.Recordset
With cnn
    .ActiveConnection = constr
    .CursorLocation = adUseClient
    .CursorType = adOpenDynamic
    .LockType = adLockBatchOptimistic
    .Open "select * from mmb where yhm='" & Trim(Combo1.Text) & "'"
    If Trim(Text2.Text) <> .Fields("yhmm").Value Then
        MsgBox "密码错误,请重输!", vbInformation, "提示"
        Text2.Text = ""
        Text2.SetFocus
    Else
        yhm1 = Trim(Combo1.Text)
        ok = True
        Me.Hide
    End If
    .Close
End With
Set cnn = Nothing
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    Call cmok
End If
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?