📄 form6.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "Msflxgrd.ocx"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form user
Caption = "用户信息管理"
ClientHeight = 5940
ClientLeft = 60
ClientTop = 450
ClientWidth = 6270
LinkTopic = "Form4"
ScaleHeight = 5940
ScaleWidth = 6270
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "确 认"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4080
TabIndex = 24
Top = 5280
Width = 1335
End
Begin VB.Data DataUser
Caption = "Data1"
Connect = "Access"
DatabaseName = "F:\作业\作业\database2.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 495
Left = 840
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "User"
Top = 5280
Width = 2415
End
Begin TabDlg.SSTab SSTab2
Height = 4815
Left = 240
TabIndex = 0
Top = 240
Width = 5775
_ExtentX = 10186
_ExtentY = 8493
_Version = 393216
Tab = 2
TabHeight = 520
TabCaption(0) = "用户信息"
TabPicture(0) = "Form6.frx":0000
Tab(0).ControlEnabled= 0 'False
Tab(0).Control(0)= "Frame1"
Tab(0).Control(1)= "Command5"
Tab(0).Control(2)= "Command6"
Tab(0).Control(3)= "Command7"
Tab(0).Control(4)= "Command3"
Tab(0).ControlCount= 5
TabCaption(1) = "添加用户"
TabPicture(1) = "Form6.frx":001C
Tab(1).ControlEnabled= 0 'False
Tab(1).Control(0)= "Frame4"
Tab(1).Control(1)= "Command10"
Tab(1).Control(2)= "Command1"
Tab(1).ControlCount= 3
TabCaption(2) = "修改用户信息"
TabPicture(2) = "Form6.frx":0038
Tab(2).ControlEnabled= -1 'True
Tab(2).Control(0)= "Command11"
Tab(2).Control(0).Enabled= 0 'False
Tab(2).Control(1)= "Command9"
Tab(2).Control(1).Enabled= 0 'False
Tab(2).Control(2)= "Frame5"
Tab(2).Control(2).Enabled= 0 'False
Tab(2).ControlCount= 3
Begin VB.CommandButton Command3
Caption = "刷 新"
Height = 495
Left = -70680
TabIndex = 25
Top = 4080
Width = 1095
End
Begin VB.CommandButton Command7
Caption = "删 除"
Height = 495
Left = -72000
TabIndex = 23
Top = 4080
Width = 1095
End
Begin VB.CommandButton Command6
Caption = "修 改"
Height = 495
Left = -73320
TabIndex = 22
Top = 4080
Width = 1095
End
Begin VB.CommandButton Command5
Caption = "添 加"
Height = 495
Left = -74640
TabIndex = 21
Top = 4080
Width = 1095
End
Begin VB.Frame Frame1
Caption = "用户信息"
Height = 3495
Left = -74880
TabIndex = 19
Top = 480
Width = 5535
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Bindings = "Form6.frx":0054
Height = 2895
Left = 120
TabIndex = 20
Top = 360
Width = 5175
_ExtentX = 9128
_ExtentY = 5106
_Version = 393216
End
End
Begin VB.Frame Frame4
Caption = "添加用户"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2895
Left = -74760
TabIndex = 12
Top = 720
Width = 5295
Begin VB.TextBox Text5
Height = 375
Left = 2280
TabIndex = 15
Top = 600
Width = 1575
End
Begin VB.TextBox Text6
Height = 375
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 14
Top = 1200
Width = 1575
End
Begin VB.ComboBox Combo4
Height = 315
Left = 2280
TabIndex = 13
Text = "请选择:"
Top = 1800
Width = 1575
End
Begin VB.Label Label7
Caption = "用户名"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 960
TabIndex = 18
Top = 600
Width = 735
End
Begin VB.Label Label8
Caption = "口 令"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 17
Top = 1200
Width = 855
End
Begin VB.Label Label9
Caption = "角 色"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 16
Top = 1800
Width = 855
End
End
Begin VB.CommandButton Command10
Caption = "重 填"
Height = 375
Left = -71520
TabIndex = 11
Top = 3960
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "提 交"
Height = 375
Left = -74160
TabIndex = 10
Top = 3960
Width = 1095
End
Begin VB.Frame Frame5
Caption = "用户信息修改"
Height = 2895
Left = 360
TabIndex = 3
Top = 720
Width = 5055
Begin VB.TextBox Text7
Height = 375
Left = 2160
TabIndex = 6
Top = 600
Width = 1575
End
Begin VB.TextBox Text8
Height = 375
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 5
Top = 1200
Width = 1575
End
Begin VB.ComboBox Combo3
Height = 315
Left = 2160
TabIndex = 4
Text = "请选择:"
Top = 1800
Width = 1575
End
Begin VB.Label Label10
Caption = "用户名"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 9
Top = 600
Width = 855
End
Begin VB.Label Label11
Caption = "口 令"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 8
Top = 1200
Width = 855
End
Begin VB.Label Label12
Caption = "角 色"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 840
TabIndex = 7
Top = 1800
Width = 1095
End
End
Begin VB.CommandButton Command9
Caption = "提 交"
Height = 375
Left = 960
TabIndex = 2
Top = 3960
Width = 1215
End
Begin VB.CommandButton Command11
Caption = "重 填"
Height = 375
Left = 3360
TabIndex = 1
Top = 3960
Width = 1215
End
End
End
Attribute VB_Name = "user"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Database
Dim rs As Recordset
Private Sub Command1_Click()
If Combo4.Text = "sa" Then
power = 100
End If
If Combo4.Text = "staff" Then
power = 50
End If
If Combo4.Text = "customer" Then
power = 1
End If
With rs
.AddNew
!uid = LCase(Text5.Text)
!pwd = LCase(Text6.Text)
!role = LCase(Combo4.Text)
!power = power
.Update
End With
MsgBox (newName & " Was Added To The DataBase ")
SSTab2.Tab = 0
End Sub
Private Sub Command2_Click()
SSTab2.Tab = 1
End Sub
Private Sub Command3_Click()
DataUser.Refresh
End Sub
Private Sub Command5_Click()
SSTab2.Tab = 1
End Sub
Private Sub Command6_Click()
MSFlexGrid1.Col = 1
Text7 = MSFlexGrid1.Text
uid = MSFlexGrid1.Text
MSFlexGrid1.Col = 2
Text8 = MSFlexGrid1.Text
MSFlexGrid1.Col = 3
Combo3.Text = MSFlexGrid1.Text
MSFlexGrid1.Col = 4
power = MSFlexGrid1.Text
DataUser.RecordSource = "select * from user where uid = '" & Text7.Text & "' and pwd = '" & Text8.Text & "'"
SSTab2.Tab = 2
End Sub
Private Sub Command9_Click()
DataUser.Recordset.Edit
If Text7.Text <> "" Then DataUser.Recordset.Fields("uid") = Text7.Text
If Text8.Text <> "" Then DataUser.Recordset.Fields("pwd") = Text8.Text
If Combo3.Text <> "" Then DataUser.Recordset.Fields("role") = Combo3.Text
If Combo3.Text = "sa" Then
power = 100
End If
If Combo3.Text = "manage" Then
power = 50
End If
If Combo3.Text = "staff" Then
power = 1
End If
DataUser.Recordset.Fields("power") = power
DataUser.Recordset.Update
DataUser.Refresh
MsgBox (newName & " modified the user data! ")
SSTab2.Tab = 0
End Sub
Private Sub Form_Load()
Combo4.AddItem ("sa")
Combo4.AddItem ("staff")
Combo4.AddItem ("customer")
Combo4.ListIndex = 0
Combo3.AddItem ("sa")
Combo3.AddItem ("staff")
Combo3.AddItem ("customer")
Combo3.ListIndex = 0
SSTab2.Tab = 0
Set db = OpenDatabase(App.Path + "/database2.mdb")
Set rs = db.OpenRecordset("user")
'Dim td As TableDef
If rs.EOF Then
MsgBox "Please Add Someone To The Databse"
Else
rs.MoveFirst
Text5.Text = rs.Fields("uid")
Text6.Text = rs.Fields("pwd")
Combo4.Text = rs.Fields("role")
power = rs.Fields("power")
End If
Text5.Text = ""
Text6.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -