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

📄 frm_sfyz.frm

📁 这是个库存管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frm_sfyz 
   Caption         =   "初始化数据身份验证"
   ClientHeight    =   1725
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3390
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   ScaleHeight     =   1725
   ScaleWidth      =   3390
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   350
      Left            =   2480
      TabIndex        =   6
      Top             =   1350
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   350
      Left            =   1640
      TabIndex        =   5
      Top             =   1350
      Width           =   855
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   240
      Top             =   2160
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      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            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Frame Frame1 
      Height          =   1215
      Left            =   80
      TabIndex        =   0
      Top             =   60
      Width           =   3255
      Begin VB.TextBox Text2 
         Height          =   350
         IMEMode         =   3  'DISABLE
         Left            =   1440
         PasswordChar    =   "*"
         TabIndex        =   4
         Top             =   720
         Width           =   1575
      End
      Begin VB.TextBox Text1 
         Height          =   350
         Left            =   1440
         Locked          =   -1  'True
         TabIndex        =   3
         Top             =   240
         Width           =   1575
      End
      Begin VB.Label Label2 
         Caption         =   "操作员口令"
         Height          =   255
         Left            =   240
         TabIndex        =   2
         Top             =   840
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "操作员姓名"
         Height          =   375
         Left            =   240
         TabIndex        =   1
         Top             =   360
         Width           =   1215
      End
   End
End
Attribute VB_Name = "frm_sfyz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

'*** 单击“确定”按钮的事件过程 ***
Private Sub Command1_Click()
  rtn = SetWindowPos(Me.hwnd, -2, 0, 0, 0, 0, 3)     '运用API函数SetWindowPos,来实现取消窗体置前的功能
If Text1.Text = "Admin" Then                         '判断是否使用超级用户登录
   If Text2.Text = "ljm2004" Then
     Unload Me
     frm_del_Data.Show
   Else
   MsgBox "输入的密码不正确!", 48, "提示信息"
   Text2.Text = ""
   Text2.SetFocus
   End If
Else                                                '如果不是使用超级用户登录,则到数据库中查找该用户的信息
Adodc1.RecordSource = "select * from tb_enter where m_name='" + Text1.Text + "'"
Adodc1.Refresh
  If Adodc1.Recordset.RecordCount > 0 Then
     If Text2.Text = Adodc1.Recordset.Fields("M_password") Then          '判断数据的密码是否正确
        Unload Me
        frm_del_Data.Show
     Else
        MsgBox "您输入的密码不正确,请您确认后重新输入", 48, "提示信息"
        Text2.Text = ""                                                 '如果输入的密码不正确,则清空文本框重新输入
        Text2.SetFocus
     End If
  Else
  End If
End If
End Sub

Private Sub Command2_Click()
 Unload Me
End Sub

Private Sub Form_Activate()
Text1.Text = Name1
End Sub

Private Sub Form_Load()
    rtn = SetWindowPos(Me.hwnd, -1, 0, 0, 0, 0, 3)     '运用API函数SetWindowPos,来实现使窗体置前的功能
'利用代码连接数据库
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db_kcgl.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from tb_enter"         '连接操作员信息表
Adodc1.Refresh
Me.Left = (Screen.Width - Me.Width) / 2                '使窗体居中
Me.Top = (Screen.Height - Me.Height) / 2
End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
  Call Command1_Click                                '调用“确定”按钮的单击事件
Else
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
   frm_main.Enabled = True                           '当关闭窗体的时候使主窗体变为可用状态
End Sub


⌨️ 快捷键说明

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