⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yhdl.frm

📁 vb数据库编程资料
💻 FRM
字号:
VERSION 5.00
Begin VB.Form yhdl 
   Caption         =   "Form1"
   ClientHeight    =   1950
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4770
   LinkTopic       =   "Form1"
   ScaleHeight     =   1950
   ScaleWidth      =   4770
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text2 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1680
      MaxLength       =   8
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   840
      Width           =   2055
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1680
      MaxLength       =   8
      TabIndex        =   0
      Top             =   240
      Width           =   2055
   End
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   ""
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   375
      Left            =   2880
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   ""
      Top             =   1440
      Visible         =   0   'False
      Width           =   1575
   End
   Begin VB.Label Label2 
      Caption         =   "请输入口令:"
      Height          =   375
      Left            =   120
      TabIndex        =   3
      Top             =   840
      Width           =   1095
   End
   Begin VB.Label Label1 
      Caption         =   "请输入用户名:"
      Height          =   255
      Left            =   120
      TabIndex        =   1
      Top             =   240
      Width           =   1455
   End
End
Attribute VB_Name = "yhdl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private time As Integer
Private Sub Form_Load()
  time = 0
  gly = False
  Data1.DatabaseName = App.Path + "\tsglxx.mdb"
  Data1.RecordSource = "yhxx"
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
 If KeyAscii = 13 Then
      Data1.Recordset.FindFirst "username=" & "'" & Text1.Text & "'"
      If Data1.Recordset.NoMatch Then
          time = time + 1
          If time < 3 Then
             MsgBox ("无此用户,请重新输入!")
             Text1.Text = ""
             Text1.SetFocus
          Else
             MsgBox ("对不起,你无法进入系统!")
             End
          End If
      Else
             Text2.SetFocus
             time = 0
      End If
 End If
End Sub

Private Sub Text1_LostFocus()
  Call Text1_KeyPress(13)
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
 If KeyAscii = 13 Then
      If Data1.Recordset.Fields("userpass") <> Text2.Text Then
          time = time + 1
          If time < 3 Then
             MsgBox ("口令错误,请重新输入!")
             Text2.Text = ""
             Text2.SetFocus
          Else
             MsgBox ("对不起,你无法进入系统!")
             End
          End If
      Else
             Data1.Recordset.MoveFirst
             If Data1.Recordset.Fields("username") = Text1.Text Then
                 gly = True
             Else
                 gly = False
             End If
             yhm = Text1.Text
             Data1.Recordset.Close
             Unload Me
             tsxxgl.Show
      End If
 End If
End Sub

⌨️ 快捷键说明

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