📄 czrygl.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form czrygl
BorderStyle = 1 'Fixed Single
Caption = "用户管理"
ClientHeight = 4125
ClientLeft = 3825
ClientTop = 2595
ClientWidth = 8100
Icon = "czrygl.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4125
ScaleWidth = 8100
Begin VB.CommandButton Command1
Caption = "添加人员(&T)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 5
Left = 6240
TabIndex = 6
Top = 2400
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "权限分配(&Q)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 3
Left = 6240
TabIndex = 4
Top = 960
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "退出(&E)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 4
Left = 6240
TabIndex = 3
Top = 3120
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "删除人员(&S)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 2
Left = 6240
TabIndex = 2
Top = 1680
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "更改密码(&X)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 1
Left = 6240
TabIndex = 1
Top = 240
Width = 1575
End
Begin VB.Frame Frame1
Height = 4095
Left = 0
TabIndex = 0
Top = 0
Width = 5895
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 495
Left = 2400
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "zyzl"
Top = 2640
Visible = 0 'False
Width = 2415
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid
Bindings = "czrygl.frx":0442
Height = 3735
Left = 120
TabIndex = 5
Top = 240
Width = 5690
_ExtentX = 10028
_ExtentY = 6588
_Version = 393216
Rows = 20
Cols = 7
BackColor = -2147483624
ForeColor = 0
ForeColorFixed = 0
BackColorSel = 64
ForeColorSel = 16777215
BackColorBkg = 16777215
GridColorFixed = 64
FocusRect = 2
GridLines = 3
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
End
Attribute VB_Name = "czrygl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public bh As String
Public dj As Integer
Private Sub Command1_Click(Index As Integer)
Dim c, d As Integer
c = czrygl.MSFlexGrid.Row
d = czrygl.MSFlexGrid.Col
Select Case Index
Case 1
If dj = 3 Then
Form12.Show
Form12.Label2.Caption = Me.MSFlexGrid.TextMatrix(c, 1)
Form12.Text1.SetFocus
Else
MsgBox "请先选好要修改的职员的密码", vbInformation, "提示"
End If
Case 2
Dim strfind As String
Dim Msg, Style, Title, Ctxt, Response, MyString
If dj = 3 Then
'********************************************
If czrygl.MSFlexGrid.TextMatrix(c, 1) = "0001w" Then
MsgBox "系统管理员不可删除", vbCritical, "警告"
Exit Sub
End If
'czrygl.Data1.Recordset.Fields(3).Value = czrygl.MSFlexGrid.TextMatrix(a, b)
'指针定位
'czrygl.Data1.Recordset.MoveNext
'If czrygl.Data1.Recordset.BOF = True Then
' czrygl.Data1.Recordset.Delete
' Exit Sub
' czrygl.Data1.Recordset.MoveNext
' Else
' czrygl.Data1.Recordset.MoveLast
'End If
' czrygl.Data1.Recordset.MovePrevious
strfind = czrygl.MSFlexGrid.TextMatrix(c, 1)
czrygl.Data1.Recordset.FindFirst "zybh = " & "'" & strfind & "'"
Msg = "确实要删除此记录吗?" ' 定义信息。
Style = vbYesNo + vbCritical + vbDefaultButton2 ' 定义按钮。
Title = "提示" ' 定义标题。
Ctxt = 1000 ' 定义标题
' 上下文。
' 显示信息。
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' 用户按下“是”。
MyString = "Yes" ' 完成某操作。
'czrygl.Data1.Recordset.MoveNext
'On Error GoTo endthis
czrygl.Data1.Recordset.Delete
czrygl.Data1.Refresh
czrygl.Hide
Call Form_Activate
czrygl.Show
Else ' 用户按下“否”。
MyString = "No" ' 完成某操作。
czrygl.Show
End If
'****************************************************
Else
MsgBox "请先选好要删除的职员", vbInformation, "提示"
czrygl.Show
End If
Case 3
If dj = 3 Then
'Dim a As Integer
' a = czrygl.MSFlexGrid.Row
'b= czrygl.MSFlexGrid.Col
If czrygl.MSFlexGrid.TextMatrix(c, 1) = "0001w" Then
MsgBox "系统管理员不可分配权限!", vbCritical, "警告"
czrygl.Show
Exit Sub
End If
bh = czrygl.MSFlexGrid.TextMatrix(c, 1)
'czrygl.Data1.Recordset.FindFirst "zybh = " & "'" & bh & "'"
qxfp1.Data1.Recordset.FindFirst "zybh = " & "'" & bh & "'"
qxfp1.Show
Else
MsgBox "请先选好权限要分配的对象", vbInformation, "提示"
czrygl.Show
End If
Case 4
Unload Me
Case 5
czrytj.Show
End Select
'endthis:
'czrygl.Data1.Recordset.Delete
' czrygl.Data1.Refresh
'Call Form_Activate
End Sub
Private Sub Command2_Click()
Check1.Value = 1
'Debug.Print Data1.Recordset.Fields(3).Value
End Sub
Private Sub Form_Activate()
MSFlexGrid.TextMatrix(0, 1) = "职员编号"
MSFlexGrid.TextMatrix(0, 2) = "姓名"
MSFlexGrid.TextMatrix(0, 3) = "密码"
MSFlexGrid.ColWidth(0) = 200
MSFlexGrid.ColWidth(1) = 1800
MSFlexGrid.ColWidth(2) = 1800
MSFlexGrid.ColWidth(3) = 1800
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\db1.mdb"
Data1.RecordSource = "select * from yhmm"
'MSFlexGrid.FormatString = " 职员编号; 姓名"
'MSFlexGrid.TextMatrix(0, 1) = "职员"
'Debug.Print Data1.Recordset.Fields(0).Name
'Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;DataSource=" & App.Path & "\db1.mdb"
'Adodc1.CommandType = adCmdTable
'Adodc1.RecordSource = "select * from zyzl"
'Adodc1.Refresh
'Data1.DatabaseName = App.Path & "\db1.mdb"
'Set DataGrid1.DataSource = Adodc1
' Set MSFlexGrid.DataSource = Data1
'Set Text1.DataSource = Data1
End Sub
Private Sub MSFlexGrid_Click()
dj = 3
f = czrygl.MSFlexGrid.Row
k = czrygl.MSFlexGrid.Col
qxfp1.Text1.Text = " 编号: " & czrygl.MSFlexGrid.TextMatrix(f, 1) & " 姓名: " & czrygl.MSFlexGrid.TextMatrix(f, 2)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -