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

📄 用户管理.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 用户管理 
   BackColor       =   &H00C0FFC0&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "用户设置"
   ClientHeight    =   4455
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4890
   HelpContextID   =   2410
   Icon            =   "用户管理.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4455
   ScaleWidth      =   4890
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton 删除用户 
      BackColor       =   &H00C0FFC0&
      Caption         =   "删除用户"
      Height          =   375
      HelpContextID   =   2410
      Left            =   540
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   3840
      WhatsThisHelpID =   2410
      Width           =   1215
   End
   Begin VB.CommandButton 修改权限 
      BackColor       =   &H00C0FFC0&
      Caption         =   "修改权限"
      Height          =   375
      HelpContextID   =   2410
      Left            =   3000
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   3840
      WhatsThisHelpID =   2410
      Width           =   1215
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Height          =   3495
      Left            =   180
      TabIndex        =   0
      Top             =   180
      WhatsThisHelpID =   2410
      Width           =   4515
      _ExtentX        =   7964
      _ExtentY        =   6165
      _Version        =   393216
      AllowUpdate     =   -1  'True
      AllowArrows     =   -1  'True
      HeadLines       =   1
      RowHeight       =   18
      AllowAddNew     =   -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            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   2
      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
      SplitCount      =   1
      BeginProperty Split0 
         MarqueeStyle    =   2
         ScrollBars      =   2
         SizeMode        =   1
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   3480
      Top             =   3480
      WhatsThisHelpID =   2410
      Width           =   1215
      _ExtentX        =   2143
      _ExtentY        =   582
      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    =   "select 用户名,用户密码,用户权限 from 用户管理"
      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 = "用户管理"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private m_IsAdd As Boolean

Private Function ModifyPurview(ByVal d As Long)

    Dim f As New 权限选择
    f.Purview = d
    If Adodc1.Recordset.Fields("用户名").Value = UserName Then f.Check(16).Enabled = False
    f.Show vbModal
    ModifyPurview = f.Purview
    Unload f
    
End Function

Private Sub initdatagrid1()
    
    DataGrid1.Columns(0).Width = 2000
    DataGrid1.Columns(1).Width = 1800
    DataGrid1.Columns(2).Width = 0
    
    DataGrid1.Columns(0).AllowSizing = False
    DataGrid1.Columns(1).AllowSizing = False
    DataGrid1.Columns(2).AllowSizing = False
    
    DataGrid1.AllowRowSizing = False
    DataGrid1.Columns(0).Locked = True
    DataGrid1.Columns(2).Locked = True

End Sub

Private Sub Form_Load()

    '初始化数据源
    Adodc1.ConnectionString = DataConnectString
    Set DataGrid1.DataSource = Adodc1
    Adodc1.Refresh
    
    Adodc1.Visible = False
    
    initdatagrid1
    
End Sub

Private Sub DataGrid1_OnAddNew()

    DataGrid1.Columns(0).Locked = False
    DataGrid1.Columns(2).Value = 0
    m_IsAdd = True
    
End Sub


Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
    
    If m_IsAdd = False Then
        DataGrid1.Columns(0).Locked = True
    Else
        m_IsAdd = False
    End If
    
End Sub


Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

     '写入系统日志
     fMainForm.WriteLog ("查看或修改用户管理")
    
End Sub

Private Sub Form_Unload(Cancel As Integer)
    
    '检测当前用户名密码是否改变,如果改变则重置它
    Dim fit As String
    '查找用户名
    fit = "用户名='"
    fit = fit + UserName + "'"
    Adodc1.Recordset.Find fit
    
    Adodc1.Recordset.MoveFirst
    Adodc1.Recordset.Find fit
    '找不到该用户
    On Error GoTo reset
    If Adodc1.Recordset.EOF <> True Then UserPas = Adodc1.Recordset.Fields("用户密码").Value
    GoTo quit
reset:
    UserPas = ""
quit:
End Sub

Private Sub 删除用户_Click()
    
    On Error Resume Next
    If Adodc1.Recordset.Fields("用户名").Value = UserName Then MsgBox "不能删除当前登陆用户!": Exit Sub
    
    Adodc1.Recordset.Delete
    Adodc1.Recordset.Requery
    initdatagrid1
    
End Sub

Private Sub 修改权限_Click()
    
    On Error Resume Next
    
    Dim l1, l2 As Long
    On Error GoTo 1
    l1 = Adodc1.Recordset.Fields("用户权限").Value
    GoTo 2
1:
    l1 = 0
2:
    l2 = ModifyPurview(l1)
    If l2 <> l1 Then
        Adodc1.Recordset.Fields("用户权限").Value = l2
        Adodc1.Recordset.update
        Adodc1.Recordset.Requery
        initdatagrid1
    End If

End Sub


'此源码由程序太平洋收集整理发布,任何人都可自由转载,但需保留本站信息
'╭⌒╮┅~ ¤ 欢迎光临程序太平洋╭⌒╮
'╭⌒╭⌒╮╭⌒╮~╭⌒╮  ︶  ,︶︶
',︶︶︶︶,''︶~~ ,''~︶︶  ,''
'╔ ╱◥███◣═╬╬╬╬╬╬╬╬╬╗
'╬ ︱田︱田 田 ︱          ╬
'╬       http://www.5ivb.net ╬
'╬  ╭○╮●                     ╬
'╬  /■\/■\                    ╬
'╬   <| ||    有希望,就有成功! ╬
'╬                 ╬
'╚╬╬╬╬╬╬╬╬╬╬╗  ╔╬╬╬╬╝
'
'说明:
'专业提供VB、.NET、Delphi、ASP、PB源码下载
'包括:程序源码,控件,商业源码,系统方案,开发工具,书籍教程,技术文档


⌨️ 快捷键说明

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