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

📄 mmform.frm

📁 商品交易管理数据库
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form6 
   Caption         =   "用户权限设置"
   ClientHeight    =   3855
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5265
   LinkTopic       =   "Form6"
   ScaleHeight     =   3855
   ScaleWidth      =   5265
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command4 
      Caption         =   "删除用户"
      Height          =   375
      Left            =   3840
      TabIndex        =   7
      Top             =   2280
      Width           =   975
   End
   Begin VB.CommandButton Command3 
      Caption         =   "确认修改"
      Height          =   375
      Left            =   2760
      TabIndex        =   6
      Top             =   2280
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "修改密码"
      Height          =   375
      Left            =   1680
      TabIndex        =   5
      Top             =   2280
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "增加用户"
      Height          =   375
      Left            =   480
      TabIndex        =   4
      Top             =   2280
      Width           =   1095
   End
   Begin VB.TextBox Text2 
      DataField       =   "密码"
      DataSource      =   "Data1"
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   2040
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   1080
      Width           =   1335
   End
   Begin VB.TextBox Text1 
      DataField       =   "用户姓名"
      DataSource      =   "Data1"
      Height          =   270
      Left            =   2040
      TabIndex        =   2
      Top             =   480
      Width           =   1335
   End
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   "E:\vb写作\商品交易管理数据库\Spjybase.mdb"
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   285
      Left            =   1320
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   "yhqx"
      Top             =   1560
      Visible         =   0   'False
      Width           =   1335
   End
   Begin VB.Label Label2 
      Caption         =   "密码"
      Height          =   255
      Left            =   960
      TabIndex        =   1
      Top             =   1080
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "用户名"
      DataSource      =   "Data1"
      Height          =   255
      Left            =   960
      TabIndex        =   0
      Top             =   480
      Width           =   735
   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() '增加用户
Dim msg
oldmark = Data1.Recordset.Bookmark
msg = Trim(InputBox("请输入原用户密码", "查询"))
msg = "密码 like '" & msg & "'"
Data1.Recordset.FindFirst msg
If Data1.Recordset.NoMatch Then
   MsgBox ("你无权限增加用户")
   Data1.Recordset.Bookmark = oldmark
Else
   Data1.Recordset.AddNew
   Command4.Enabled = True
End If
End Sub

Private Sub Command2_Click() '修改密码

Dim msg
oldmark = Data1.Recordset.Bookmark
msg = Trim(InputBox("请输入原用户密码", "查询"))
msg = "密码 like '" & msg & "'"
Data1.Recordset.FindFirst msg
If Data1.Recordset.NoMatch Then
   MsgBox ("你无权限增加用户")
   Data1.Recordset.Bookmark = oldmark
Else
   Data1.Recordset.Edit
   Command4.Enabled = True
End If


End Sub

Private Sub Command3_Click() '确认修改

Data1.Recordset.Update

End Sub

Private Sub Command4_Click()      '删除用户
Dim msg
oldmark = Data1.Recordset.Bookmark
msg = Trim(InputBox("请输入原用户密码", "查询"))
msg = "密码 like '" & msg & "'"
Data1.Recordset.FindFirst msg
If Data1.Recordset.NoMatch Then
   MsgBox ("你无权删除用户")
   Data1.Recordset.Bookmark = oldmark
Else
   If MsgBox("确实要删除该用户吗", vbYesNo, "提示信息") = vbYes Then
      Adodc1.Recordset.Delete
      Adodc1.Recordset.MoveNext
    End If
End If
      

End Sub

⌨️ 快捷键说明

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