📄 frm_yhgl.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Frm_yhgl
Caption = "用户管理"
ClientHeight = 2520
ClientLeft = 60
ClientTop = 345
ClientWidth = 6195
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2520
ScaleWidth = 6195
StartUpPosition = 1 '所有者中心
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 1680
Top = 3045
Width = 2040
_ExtentX = 3598
_ExtentY = 661
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 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db_wygl.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db_wygl.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from tab_power "
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
Begin VB.Frame Frame4
Caption = "用户设置"
Height = 915
Left = 420
TabIndex = 17
Top = 330
Width = 5400
Begin VB.TextBox Text6
DataField = "操作员姓名"
DataSource = "Adodc1"
Height = 300
Left = 1200
TabIndex = 19
Top = 375
Width = 1440
End
Begin VB.TextBox Text5
DataField = "密码"
DataSource = "Adodc1"
Height = 300
Left = 3825
TabIndex = 18
Top = 360
Width = 1440
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "操作员姓名:"
Height = 180
Left = 180
TabIndex = 21
Top = 435
Width = 1080
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "密 码:"
Height = 180
Left = 2715
TabIndex = 20
Top = 450
Width = 1080
End
End
Begin VB.Frame Frame3
Height = 705
Left = 2655
TabIndex = 10
Top = 1395
Width = 3195
Begin VB.CommandButton Command10
Caption = "退出"
Height = 450
Left = 2550
TabIndex = 16
Top = 180
Width = 500
End
Begin VB.CommandButton Command9
Caption = "删除"
Height = 450
Left = 2055
TabIndex = 15
Top = 180
Width = 500
End
Begin VB.CommandButton Command8
Caption = "修改"
Height = 450
Left = 1560
TabIndex = 14
Top = 180
Width = 500
End
Begin VB.CommandButton Command7
Caption = "取消"
Height = 450
Left = 1065
TabIndex = 13
Top = 180
Width = 500
End
Begin VB.CommandButton Command6
Caption = "保存"
Height = 450
Left = 570
TabIndex = 12
Top = 180
Width = 500
End
Begin VB.CommandButton Command5
Caption = "添加"
Height = 450
Left = 75
TabIndex = 11
Top = 180
Width = 500
End
End
Begin VB.Frame Frame2
Height = 705
Left = 405
TabIndex = 5
Top = 1395
Width = 2220
Begin VB.CommandButton Command4
Caption = ">|"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 1605
TabIndex = 9
Top = 195
Width = 500
End
Begin VB.CommandButton Command3
Caption = ">"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 1110
TabIndex = 8
Top = 195
Width = 500
End
Begin VB.CommandButton Command2
Caption = "<"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 615
TabIndex = 7
Top = 195
Width = 500
End
Begin VB.CommandButton Command1
Caption = "|<"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 120
TabIndex = 6
Top = 195
Width = 500
End
End
Begin VB.Frame Frame1
Caption = "用户权限设置"
Height = 900
Left = 435
TabIndex = 0
Top = 330
Width = 5400
Begin VB.TextBox Text4
Height = 300
Left = 3810
TabIndex = 2
Top = 345
Width = 1425
End
Begin VB.TextBox Text3
Height = 300
Left = 1260
TabIndex = 1
Top = 330
Width = 1350
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "密 码:"
Height = 180
Left = 2685
TabIndex = 4
Top = 375
Width = 1080
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "操作员姓名:"
Height = 180
Left = 180
TabIndex = 3
Top = 405
Width = 1080
End
End
End
Attribute VB_Name = "Frm_yhgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim KeyCode As String
Private Sub Command1_Click()
Frame2.Visible = True
Adodc1.Recordset.MoveFirst
End Sub
Private Sub Command10_Click()
Unload Me
Frm_czygl.Show
End Sub
Private Sub Command2_Click()
Frame2.Visible = True
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF Then Adodc1.Recordset.MoveFirst
End Sub
Private Sub Command3_Click()
Frame2.Visible = True
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveLast
End Sub
Private Sub Command4_Click()
Frame2.Visible = True
Adodc1.Recordset.MoveLast
End Sub
Private Sub Command5_Click()
Frame1.Visible = True
Frame4.Visible = False
'Adodc1.RecordSource = "select * from tab_power order by 操作员编号"
'Adodc1.Refresh
'If Adodc1.Recordset.RecordCount > 0 Then
'If Adodc1.Recordset.EOF = False Then
'Adodc1.Recordset.MoveLast
'Text1.Text = Adodc1.Recordset.Fields("操作员编号") + 1
'Else
'End If
'Else
'Text1.Text = 1
'End If
'Text2.SetFocus
End Sub
Private Sub Command6_Click()
Set adors = cn.Execute("insert into tab_power (操作员姓名,密码) values('" & Text3 & "','" & Text4 & "') ")
MsgBox "数据保存成功", 78, "管理信息系统"
Adodc1.Refresh
cn.Close
End Sub
Private Sub Command7_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
End Sub
Private Sub Command8_Click()
Adodc1.Recordset.UpdateBatch
MsgBox "修改成功"
Adodc1.Refresh
End Sub
Private Sub Command9_Click()
Dim myval As String
Adodc1.RecordSource = "select * from tab_power"
If Adodc1.Recordset.RecordCount > 0 Then
myval = MsgBox("确定删除吗?", vbYesNo)
If myval = vbYes Then
Adodc1.Recordset.Delete
Adodc1.Refresh
Else
End If
Else
MsgBox "数据库中没有记录要删除"
End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text3.SetFocus
End If
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text4.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -