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

📄 form1.frm

📁 VB和ACCESS作的物品管理软件 比较容易分析
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1 
   Caption         =   "登陆系统"
   ClientHeight    =   3525
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5295
   LinkTopic       =   "Form1"
   ScaleHeight     =   3525
   ScaleWidth      =   5295
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame1 
      Caption         =   "登陆系统"
      Height          =   2655
      Left            =   480
      TabIndex        =   0
      Top             =   480
      Width           =   4335
      Begin VB.CommandButton Command2 
         Caption         =   "退出"
         Height          =   375
         Left            =   2880
         TabIndex        =   6
         Top             =   2040
         Width           =   735
      End
      Begin VB.CommandButton Command1 
         Caption         =   "登陆"
         Height          =   375
         Left            =   1680
         TabIndex        =   5
         Top             =   2040
         Width           =   735
      End
      Begin VB.TextBox Text2 
         Height          =   375
         IMEMode         =   3  'DISABLE
         Left            =   1560
         PasswordChar    =   "*"
         TabIndex        =   4
         Top             =   1320
         Width           =   1575
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   1560
         TabIndex        =   3
         Top             =   720
         Width           =   1575
      End
      Begin VB.Label Label2 
         Caption         =   "密码"
         Height          =   255
         Left            =   720
         TabIndex        =   2
         Top             =   1440
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "用户名"
         Height          =   375
         Left            =   720
         TabIndex        =   1
         Top             =   840
         Width           =   975
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   495
      Left            =   1680
      Top             =   1200
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   873
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public username As String
Private Sub Command1_Click()
    Dim password As String
    Dim cn As ADODB.Connection
    Dim rst As ADODB.Recordset
    Set cn = New ADODB.Connection
    Set rst = New ADODB.Recordset
    cn.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=db1"
    cn.Open
    Set rst = cn.Execute("select username from use where username='" & Text1.Text & "'")
    If rst.EOF Then
        MsgBox "用户名错误,请重新输入", vbExclamation + vbOKOnly, "警告"
        Text1.Text = ""
        Text1.SetFocus
        Exit Sub
    End If
    username = rst.Fields(0)
    cn.Close
    cn.Open
    Set rst = cn.Execute("select password from use where username='" & Text1.Text & "'")
    password = rst.Fields(0)
     If password <> Text2.Text Then
        MsgBox "用户密码错误,请重新输入", vbExclamation + vbOKOnly, "警告"
        Text2.Text = ""
        Text2.SetFocus
        Exit Sub
    End If
    
    If password = Text2.Text Then
    MDIForm1.Show
    Unload Me
    End If
End Sub

Private Sub Command2_Click()
  Unload Me
End Sub

⌨️ 快捷键说明

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