setmenu.frm

来自「星级酒店客房管理系统一套很不错的系统」· FRM 代码 · 共 139 行

FRM
139
字号
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form setmenu 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "设置菜单权限"
   ClientHeight    =   6435
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7605
   Icon            =   "SETMENU.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "SETMENU.frx":030A
   ScaleHeight     =   6435
   ScaleWidth      =   7605
   StartUpPosition =   1  '所有者中心
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   4785
      Top             =   4845
      Visible         =   0   'False
      Width           =   2235
      _ExtentX        =   3942
      _ExtentY        =   661
      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         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "catv"
      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 = "setmenu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
'    Data1.Recordset.Close
    Unload Me
End Sub

Private Sub Command2_Click()
    If CInt(Text2.Text) < 19 Or CInt(Text2.Text) = 0 Or (Not IsNull(Text2.Text)) Then
        'Adodc3.Recordset.Edit
        Adodc3.Recordset.Fields("使用者") = Adodc3.Recordset.Fields("使用者") & Trim(Text2)
        'Adodc3.Recordset.Update
    Else
    MsgBox "非法设置,请输入1~18之间的数字!", vbOKOnly, "错误"
    End If
End Sub

Private Sub Command3_Click()
    Dim jb As String
    Dim i As Integer
    
    If Text2.Text <> "" Or (Not IsNull(Text2.Text)) Then
        
        jb = Adodc3.Recordset.Fields("使用者")
        For i = 1 To Len(Trim(jb))
            If Mid(jb, i, 1) = Trim(Text2.Text) Then
                
                If i <> 1 Then
                
                    If i = Len(Trim(jb)) Then
                        jb = Left(jb, Len(Trim(jb)) - 1)
                    Else
                        jb = Left(jb, i) & Right(jb, Len(Trim(jb)) - i - 1)
                    End If
                Else
                
                    jb = Right(jb, Len(Trim(jb)) - 1)
                
                End If
            
            End If
            
        
        Next
        If jb = "" Then jb = "1"
        'Adodc3.Recordset.Edit
        Adodc3.Recordset.Fields("usertype") = jb
        'Adodc3.Recordset.Update
    End If
End Sub

Private Sub Command4_Click()
    Adodc3.Recordset.Update
    MsgBox "数据已保存!", 64, "提示"
End Sub

Private Sub Form_Load()
    Adodc3.ConnectionString = My_PROVIDER
    Adodc3.CommandType = adCmdText
    Adodc3.RecordSource = "select 编号,名称,使用者 from 菜单"
    Adodc3.Refresh
    Set DataGrid2.DataSource = Adodc3
    DataGrid2.ReBind
    DataGrid2.Refresh
    DataGrid2.Columns(0).Caption = "编号"
    DataGrid2.Columns(1).Caption = "菜单名称"
    DataGrid2.Columns(2).Caption = "使用者"
End Sub

⌨️ 快捷键说明

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