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

📄 form4.frm

📁 利用VB编写的财务系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form4 
   Caption         =   "Form4"
   ClientHeight    =   6150
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6540
   LinkTopic       =   "Form4"
   ScaleHeight     =   6150
   ScaleWidth      =   6540
   StartUpPosition =   3  '窗口缺省
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   855
      Left            =   960
      Top             =   4560
      Width           =   4215
      _ExtentX        =   7435
      _ExtentY        =   1508
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=kjxt.mdb;Persist Security Info=False"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=kjxt.mdb;Persist Security Info=False"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "czy"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   3360
      TabIndex        =   5
      Top             =   3360
      Width           =   1575
   End
   Begin VB.CommandButton Command1 
      Caption         =   "登录"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   960
      TabIndex        =   4
      Top             =   3360
      Width           =   1575
   End
   Begin VB.TextBox Text2 
      DataField       =   "口令"
      DataSource      =   "Adodc1"
      Height          =   735
      Left            =   2880
      TabIndex        =   3
      Top             =   1920
      Width           =   1935
   End
   Begin VB.TextBox Text1 
      DataField       =   "用户名"
      DataSource      =   "Adodc1"
      Height          =   735
      Left            =   2880
      TabIndex        =   1
      Top             =   720
      Width           =   1935
   End
   Begin VB.Label Label2 
      Caption         =   "口令"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   840
      TabIndex        =   2
      Top             =   1920
      Width           =   1575
   End
   Begin VB.Label Label1 
      Caption         =   "用户名"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   960
      TabIndex        =   0
      Top             =   720
      Width           =   1455
   End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim a As String, b As String
Static i As Integer
i = i + 1
If i > 3 Then
  MsgBox "你已经超过允许的次数" + Chr(13) + "应用程序将结束!", vbCritical, "登录验证"
End
Else
a = Trim(Text1)
b = Trim(Text2)
Select Case checkpwd(a, b)
Case 0
  MsgBox "用户名输入错误!", vbCritical, "登录验证"
  Text1.SetFocus
Case 1
  MsgBox "口令错误!", vbCritical, "登录验证"
  Text2.SetFocus
Case 2
  MsgBox "验证通过!", vbCritical, "登录验证"
  Unload Me
  MDIForm1.Show
Case Else
  MsgBox "验证错误!", vbCritical, "登录验证"
End Select
End If
End Sub

Private Function checkpwd(ByVal uid As String, ByVal pwd As String) As Byte
Dim cn As New Connection
Dim rs As New Recordset
cn.ConnectionString = Adodc1.ConnectionString
cn.Open
Set rs.ActiveConnection = cn
rs.Open "select * from yhb where 用户名='" + uid + "'"
If rs.EOF Then
  checkpwd = 0
Else
  If pwd <> rs("口令") Then
  checkpwd = 1
  Else
  checkpwd = 2
  dqyh = uid
  End If
End If
cn.Close
Set rs = Nothing
Set cn = Nothing
End Function

Private Sub Command2_Click()
Unload Me

End Sub

⌨️ 快捷键说明

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