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

📄 frmload.frm

📁 一家大型电脑公司硬件销售管理系统 vb编写 值得写数据库人员参考借鉴
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1 
   Caption         =   "登录-金恒生电脑硬件公司管理系统"
   ClientHeight    =   1155
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4305
   Icon            =   "frmload.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   1155
   ScaleWidth      =   4305
   StartUpPosition =   2  '屏幕中心
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   960
      Top             =   1560
      Width           =   2415
      _ExtentX        =   4260
      _ExtentY        =   661
      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            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取  消"
      Height          =   375
      Left            =   3000
      TabIndex        =   6
      Top             =   600
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确  定"
      Height          =   375
      Left            =   3000
      TabIndex        =   5
      Top             =   240
      Width           =   1095
   End
   Begin VB.TextBox Text2 
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   1320
      PasswordChar    =   "*"
      TabIndex        =   4
      Top             =   720
      Width           =   1455
   End
   Begin VB.TextBox Text1 
      Height          =   270
      Left            =   1320
      TabIndex        =   3
      Top             =   240
      Width           =   1455
   End
   Begin VB.Label Label3 
      Height          =   255
      Left            =   0
      TabIndex        =   2
      Top             =   2520
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "密  码:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   375
      Left            =   240
      TabIndex        =   1
      Top             =   720
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "用户名:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   375
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'欢迎你下载使用本代码,本份代码由程序太平洋提供下载学习之用
'声明:
'1.本站所有代码的版权归原作者所有,如果你使用了在本站下载的源代码
'  引起的一切纠纷(后果)与本站无关,请您尊重原作者的劳动成果!
'2.若本站在代码上有侵权之处请您与站长联系,站长会及时更正。
'网站:http://www.dapha.net
'论坛:http://www.5ivb.net
'Email:dapha@etang.com
'CopyRight 2001-2005 By dapha.net
'整理时间:2003-8-16 12:43:58

Option Explicit
Dim UName As Long

Private Sub Command1_Click()
    Dim StrUser As String
    Dim StrPassWord As String
    Dim StrYfc As String

    Adodc1.Recordset.MoveFirst

    StrUser = Adodc1.Recordset("用户名")
    StrPassWord = Adodc1.Recordset("用户密码")
    StrYfc = Adodc1.Recordset("权限")
    MsgBox StrUser
    MsgBox StrPassWord
    If Me.Text1.Text = "" Then
        MsgBox "请输入用户名!", vbOKOnly + 16, "金恒生计算机硬件公司管理系统"
        Exit Sub
    End If

    While Not (Adodc1.Recordset.EOF)
        If Me.Text1.Text <> StrUser Then
            Me.Adodc1.Recordset.MoveNext
            If Adodc1.Recordset.EOF Then
                MsgBox "当前户名不存在或密码错误!", vbOKOnly + 16, "金恒生计算机硬件公司管理系统"
                Me.Text1.Text = ""
                Me.Text2.Text = ""
                Exit Sub
            End If
            StrUser = Adodc1.Recordset("用户名")
            StrPassWord = Adodc1.Recordset("用户密码")
            StrYfc = Adodc1.Recordset("权限")

        Else
            Me.Label3.Caption = StrUser
            If Me.Text2.Text <> StrPassWord Then
                MsgBox "用户名或密码错误!", vbOKOnly + 16, "金恒生计算机硬件公司管理系统"
                Me.Text1.Text = ""
                Me.Text2.Text = ""
                Me.Text1.SetFocus
                Exit Sub
            End If
            If Me.Text2.Text = StrPassWord Then
                Form1.Hide
                'SaveSetting "cz", "user", "UN", Me.Text1.Text
                str1 = StrYfc
                User1 = StrUser
                MDIForm1.Show
                Exit Sub
            End If
        End If

    Wend

End Sub

Private Sub Command2_Click()
    End
End Sub

Private Sub Form_Load()
    Dim StrConnect As String
    '连接数据库
    StrConnect = App.Path
    If Right(StrConnect, 1) <> "\" Then StrConnect = StrConnect + "\"
    StrConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & StrConnect & "\data\kji.bgh"
    Adodc1.ConnectionString = StrConnect
    Adodc1.CommandType = adCmdText
    Adodc1.RecordSource = "SELECT * FROM [user]"
    Adodc1.Refresh
    Me.Adodc1.Visible = False
End Sub


Private Sub Text2_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then Command1_Click
End Sub
'统计结果:
'    注释共:3行

⌨️ 快捷键说明

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