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

📄 form6.frm

📁 一个关于实验室固定资产管理系统的实现与设计
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Form6 
   Caption         =   "密码修改"
   ClientHeight    =   2925
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5250
   LinkTopic       =   "Form6"
   ScaleHeight     =   2925
   ScaleWidth      =   5250
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "添加"
      Height          =   375
      Left            =   0
      TabIndex        =   17
      Top             =   1440
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "删除"
      Height          =   375
      Left            =   2160
      TabIndex        =   16
      Top             =   1440
      Width           =   975
   End
   Begin VB.CommandButton Command3 
      Caption         =   "退出"
      Height          =   375
      Left            =   4320
      TabIndex        =   15
      Top             =   1440
      Width           =   975
   End
   Begin VB.CommandButton Command4 
      Caption         =   "查询"
      Height          =   375
      Left            =   3240
      TabIndex        =   14
      Top             =   1440
      Width           =   975
   End
   Begin VB.Frame F1 
      Caption         =   "当前记录:"
      Enabled         =   0   'False
      Height          =   975
      Left            =   0
      TabIndex        =   7
      Top             =   1920
      Width           =   2655
      Begin VB.TextBox Text1 
         DataField       =   "用户名"
         DataSource      =   "A1"
         Height          =   270
         Left            =   840
         TabIndex        =   11
         Top             =   240
         Width           =   855
      End
      Begin VB.TextBox Text2 
         DataField       =   "密码"
         DataSource      =   "A1"
         Height          =   270
         Left            =   840
         TabIndex        =   10
         Top             =   600
         Width           =   855
      End
      Begin VB.CheckBox C1 
         Caption         =   "输入"
         DataField       =   "输入"
         DataSource      =   "A1"
         Height          =   255
         Left            =   1800
         TabIndex        =   9
         Top             =   240
         Width           =   735
      End
      Begin VB.CheckBox C2 
         Caption         =   "查询"
         DataField       =   "查询"
         DataSource      =   "A1"
         Height          =   255
         Left            =   1800
         TabIndex        =   8
         Top             =   600
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "用户名:"
         Height          =   255
         Left            =   120
         TabIndex        =   13
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Label2 
         Caption         =   "密  码:"
         Height          =   255
         Left            =   120
         TabIndex        =   12
         Top             =   600
         Width           =   735
      End
   End
   Begin VB.CommandButton Command5 
      Caption         =   "修改"
      Height          =   375
      Left            =   1080
      TabIndex        =   6
      Top             =   1440
      Width           =   975
   End
   Begin VB.Frame F2 
      Caption         =   "查询:"
      Enabled         =   0   'False
      Height          =   975
      Left            =   2760
      TabIndex        =   0
      Top             =   1920
      Width           =   2535
      Begin VB.TextBox Text3 
         Height          =   270
         Left            =   1200
         TabIndex        =   3
         Top             =   240
         Width           =   975
      End
      Begin VB.CommandButton Command6 
         Caption         =   "查询"
         Height          =   255
         Left            =   240
         TabIndex        =   2
         Top             =   600
         Width           =   855
      End
      Begin VB.CommandButton Command7 
         Caption         =   "下一个"
         Height          =   255
         Left            =   1440
         TabIndex        =   1
         Top             =   600
         Width           =   855
      End
      Begin VB.Label Label3 
         Caption         =   "用户名:"
         Height          =   255
         Left            =   360
         TabIndex        =   4
         Top             =   290
         Width           =   735
      End
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Bindings        =   "Form6.frx":0000
      Height          =   1335
      Left            =   0
      TabIndex        =   5
      Top             =   0
      Width           =   5295
      _ExtentX        =   9340
      _ExtentY        =   2355
      _Version        =   393216
      AllowUpdate     =   0   'False
      Enabled         =   0   'False
      HeadLines       =   1
      RowHeight       =   15
      FormatLocked    =   -1  'True
      AllowAddNew     =   -1  'True
      AllowDelete     =   -1  'True
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   4
      BeginProperty Column00 
         DataField       =   "用户名"
         Caption         =   "用户名"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   "密码"
         Caption         =   "密码"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column02 
         DataField       =   "输入"
         Caption         =   "输入"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column03 
         DataField       =   "查询"
         Caption         =   "查询"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
            ColumnWidth     =   1260.284
         EndProperty
         BeginProperty Column01 
            ColumnWidth     =   1349.858
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   1110.047
         EndProperty
         BeginProperty Column03 
            ColumnWidth     =   1230.236
         EndProperty
      EndProperty
   End
   Begin MSAdodcLib.Adodc A1 
      Height          =   330
      Left            =   240
      Tag             =   "2"
      Top             =   3480
      Visible         =   0   'False
      Width           =   4200
      _ExtentX        =   7408
      _ExtentY        =   582
      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=gm.mdb;Persist Security Info=False;Jet OLEDB:Database Password=3328571"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=gm.mdb;Persist Security Info=False;Jet OLEDB:Database Password=3328571"
      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
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If A1.Recordset.BOF = True And A1.Recordset.EOF = True Then
MsgBox "您输入的第一个管理员是系统管理员,是用来设置用户的,请不要删除!", 64, "提示:"
A1.Tag = 1
C1.Visible = False
C2.Visible = False
End If
If Command1.Caption = "添加" Then
A1.Recordset.AddNew
C1.Value = 0
C2.Value = 0
F1.Enabled = True
Command1.Caption = "添加完毕"
Command5.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Else
    If Text1.Text = "" And Text2.Text = "" Then
    MsgBox "您没有输入用户名或密码!", 16, "出错:"
    Text1.Text = "123"
    A1.Recordset.Delete
    F1.Enabled = False
    Command1.Caption = "添加"
    F1.Caption = "当前记录:"
    Command5.Enabled = True
    Command2.Enabled = True
    Command3.Enabled = True
    Command4.Enabled = True
    Else
        If A1.Tag = 1 Then
             F1.Enabled = False
             Command1.Caption = "添加"
             Command5.Enabled = True
             Command2.Enabled = True
             Command3.Enabled = True
             Command4.Enabled = True
             C1.Visible = True
             C2.Visible = True
             A1.Tag = 2
             
        Else
             If C2.Value = 1 Or C1.Value = 1 Then
             F1.Enabled = False
             Command1.Caption = "添加"
             Command5.Enabled = True
             Command2.Enabled = True
             Command3.Enabled = True
             Command4.Enabled = True
             Else
             MsgBox "您没有输入权限!", 16, "出错:"
             End If
        End If
    End If
End If
End Sub



Private Sub Command2_Click()
If A1.Recordset.EOF = True Or A1.Recordset.BOF = True Then
MsgBox "数据库中没有记录!", 16, "出错:"
Else
A1.Recordset.Delete
End If
End Sub

Private Sub Command3_Click()
 Unload Me
End Sub

Private Sub Command4_Click()
If A1.Recordset.BOF = True And A1.Recordset.EOF Then
MsgBox "数据库中没有记录!", 16, "出错:"
Else
If Command4.Caption = "查询" Then
F2.Enabled = True
Command5.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command1.Enabled = False
Command4.Caption = "查询完毕"
Text3.Text = ""
Else
F2.Enabled = False
Command5.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command1.Enabled = True
Command4.Caption = "查询"
Text3.Text = ""
End If
End If
End Sub

Private Sub Command5_Click()
If A1.Recordset.BOF = True Or A1.Recordset.EOF = True Then
MsgBox "数据库中没有记录!", 16, "出错:"
Else
If Command5.Caption = "修改" Then
Command5.Caption = "修改完毕"
F1.Caption = "修改记录:"
F1.Enabled = True
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Else
If Text1.Text = "" Or Text2.Text = "" Then
X = MsgBox("您没有输入用户名或密码,要删除吗?", 17, "出错:")
    If X = 1 Then
    Text1.Text = "123"
    Text2.Text = "123"
    A1.Recordset.Delete
    Else
    Exit Sub
    End If
Else
             If C2.Value = 1 Or C1.Value = 1 Then
             F1.Enabled = False
             Command5.Caption = "修改"
             Command1.Enabled = True
             Command2.Enabled = True
             Command3.Enabled = True
             Command4.Enabled = True
             Else
             MsgBox "您没有输入权限!", 16, "出错:"
             End If
End If
End If
End If
End Sub

Private Sub Command6_Click()
A1.Recordset.AbsolutePosition = 1
For X = 1 To 1
If A1.Recordset.EOF = True Then
MsgBox "没有找到记录!", 64, "提示:"
Else
    If Trim(Text3.Text) = Trim(Text1.Text) Then
    Exit Sub
    Else
    X = X - 1
    A1.Recordset.MoveNext
    End If
End If
Next X
End Sub

Private Sub Command7_Click()
For X = 1 To 1
A1.Recordset.MoveNext
If A1.Recordset.EOF = True Then
MsgBox "没有找到记录!", 64, "提示:"
A1.Recordset.AbsolutePosition = 1
Else
    If Trim(Text3.Text) = Trim(Text1.Text) Then
    Exit Sub
    Else
    X = X - 1
    End If
End If
Next X
End Sub

Private Sub Form_Load()
Text1.Tag = Text1.Text
End Sub

Private Sub Form_Unload(Cancel As Integer)
If Command3.Enabled = True Then
Cancel = 0
Else
MsgBox "请编辑完这条记录再退出!", 64, "提示:"
 Cancel = 1
End If
End Sub


⌨️ 快捷键说明

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