📄 form5.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 user
Caption = "设置用户"
ClientHeight = 4050
ClientLeft = 2865
ClientTop = 2595
ClientWidth = 6840
LinkTopic = "Form5"
ScaleHeight = 4050
ScaleWidth = 6840
Begin VB.CommandButton Command3
Caption = " 退 出 "
Height = 375
Left = 5160
TabIndex = 11
Top = 3240
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "修 改"
Height = 375
Left = 5160
TabIndex = 10
Top = 2520
Width = 1215
End
Begin VB.Frame Frame1
Caption = "添加新用户"
Height = 1575
Left = 120
TabIndex = 1
Top = 2280
Width = 4935
Begin VB.ComboBox Combo1
DataSource = "Adodc1"
Height = 300
ItemData = "Form5.frx":0000
Left = 3000
List = "Form5.frx":000A
TabIndex = 12
Top = 600
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 375
Left = 3480
TabIndex = 5
Top = 1080
Width = 1335
End
Begin VB.TextBox Text4
DataSource = "Adodc1"
Height = 270
Left = 3000
TabIndex = 4
Top = 240
Width = 1335
End
Begin VB.TextBox Text2
DataSource = "Adodc1"
Height = 270
Left = 840
TabIndex = 3
Top = 600
Width = 1095
End
Begin VB.TextBox Text1
DataSource = "Adodc1"
Height = 270
Left = 840
TabIndex = 2
Top = 240
Width = 1095
End
Begin VB.Label Label5
Caption = "部门:"
Height = 255
Left = 2400
TabIndex = 9
Top = 240
Width = 615
End
Begin VB.Label Label4
Caption = "权限:"
Height = 255
Left = 2400
TabIndex = 8
Top = 600
Width = 855
End
Begin VB.Label Label3
Caption = "密码:"
Height = 255
Left = 240
TabIndex = 7
Top = 600
Width = 615
End
Begin VB.Label Label1
Caption = "名字:"
Height = 255
Left = 240
TabIndex = 6
Top = 240
Width = 615
End
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Form5.frx":0020
Height = 2055
Left = 120
TabIndex = 0
Top = 120
Width = 6495
_ExtentX = 11456
_ExtentY = 3625
_Version = 393216
AllowUpdate = 0 'False
AllowArrows = 0 'False
HeadLines = 1
RowHeight = 15
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 = "宋体"
Size = 9
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
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 720
Top = 3840
Visible = 0 'False
Width = 3255
_ExtentX = 5741
_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 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\zjssoft\zjsdata.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\zjssoft\zjsdata.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "admin"
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 = "user"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If (Command1.Caption = "保存") Then '思路是如果COMMAND2的CAPOTION=停止的话
DataGrid1.AllowAddNew = False
DataGrid1.AllowUpdate = False
DataGrid1.AllowArrows = False
DataGrid1.AllowDelete = False
Command1.Caption = "添加"
Exit Sub
Else
If Text1.Text = "" Or (Text2.Text = "" Or Text4.Text = "" Or Combo1.Text = "") Then
MsgBox "输入信息不完整,请重输入", vbOKOnly + vbExclamation, "提示"
Text1.SetFocus
Exit Sub
Else
Command1.Caption = "保存"
Command1.Visible = True
DataGrid1.AllowDelete = True
DataGrid1.AllowUpdate = True
DataGrid1.AllowArrows = True
DataGrid1.AllowAddNew = True
Adodc1.Recordset.addnew
Adodc1.Recordset("用户ID") = Text1.Text
Adodc1.Recordset("用户密码") = Text2.Text
Adodc1.Recordset("部门") = Text4.Text
Adodc1.Recordset("用户权限") = Combo1.Text
Refresh
Text1.Text = ""
Text2.Text = ""
Text4.Text = ""
Combo1.Text = ""
End If
End If
End Sub
Private Sub Command2_Click()
If (Command2.Caption = "停止") Then '思路是如果COMMAND2的CAPOTION=停止的话
DataGrid1.AllowAddNew = False
DataGrid1.AllowUpdate = False
DataGrid1.AllowArrows = False
DataGrid1.AllowDelete = False
Command2.Caption = "修改"
Exit Sub
Else
Command2.Caption = "停止"
Command2.Visible = True
DataGrid1.AllowDelete = True
DataGrid1.AllowUpdate = True
DataGrid1.AllowArrows = True
DataGrid1.AllowAddNew = True
End If
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
Text1.Text = ""
Text2.Text = ""
Text4.Text = ""
Combo1.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -