📄 修改用户资料.frm
字号:
VERSION 5.00
Begin VB.Form Form3
Caption = "修改用户资料"
ClientHeight = 6630
ClientLeft = 60
ClientTop = 345
ClientWidth = 7395
LinkTopic = "Form3"
MouseIcon = "修改用户资料.frx":0000
ScaleHeight = 6630
ScaleWidth = 7395
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "退出修改"
Height = 375
Left = 5640
TabIndex = 14
Top = 5880
Width = 1095
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "系统数据库.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 2760
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "登录信息"
Top = 5160
Visible = 0 'False
Width = 2175
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "修改用户资料.frx":030A
Left = 3480
List = "修改用户资料.frx":0314
TabIndex = 13
Text = "请选择"
Top = 600
Width = 2415
End
Begin VB.TextBox Text1
Height = 495
Index = 0
Left = 3480
TabIndex = 12
Top = 1200
Width = 2415
End
Begin VB.TextBox Text1
Height = 495
Index = 4
Left = 3480
TabIndex = 10
Top = 4080
Width = 2415
End
Begin VB.TextBox Text1
Height = 495
Index = 3
Left = 3480
TabIndex = 9
Top = 3360
Width = 2415
End
Begin VB.TextBox Text1
Height = 495
IMEMode = 3 'DISABLE
Index = 2
Left = 3480
PasswordChar = "*"
TabIndex = 8
Top = 2640
Width = 2415
End
Begin VB.TextBox Text1
Height = 495
Index = 1
Left = 3480
TabIndex = 7
Top = 1920
Width = 2415
End
Begin VB.CommandButton Command2
Caption = "重填"
Height = 375
Left = 3240
TabIndex = 6
Top = 5880
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "提交"
Height = 375
Left = 1200
TabIndex = 5
Top = 5880
Width = 1215
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "用户类别:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1320
TabIndex = 11
Top = 600
Width = 1200
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "重新输入新密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1320
TabIndex = 4
Top = 4200
Width = 1935
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "新密码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1320
TabIndex = 3
Top = 3480
Width = 735
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "原密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1320
TabIndex = 2
Top = 2640
Width = 975
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "请输入新的用户名:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1320
TabIndex = 1
Top = 1920
Width = 2175
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "原用户名:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1320
TabIndex = 0
Top = 1320
Width = 1200
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'以下是修改用户资料
Private Sub Command1_Click()
Dim db As Database, i, j As Long, rs As Recordset
Set db = OpenDatabase(App.Path + "/系统数据库.mdb")
Set rs = db.OpenRecordset("登录信息", dbOpenTable)
j = rs.RecordCount
If Combo1.ListIndex = 0 Or Combo1.ListIndex = 1 Then
If Text1(0).Text = "" And Text1(1).Text = "" And Text1(2).Text = "" And Text1(3).Text = "" And Text1(4).Text = "" Then
MsgBox "记录不能为空", vbOKOnly, "警告"
Combo1.SetFocus
Else
3: If Text1(3).Text = Text1(4).Text Then
2: If rs.Fields(1).Value = Text1(2).Text Then
1: If rs.Fields(2).Value = Combo1.ListIndex Then
rs.Edit
rs.Fields(0).Value = Text1(1).Text
rs.Fields(1).Value = Text1(3).Text
rs.Fields(2).Value = Combo1.ListIndex
rs.Update
rs.Fields.Refresh
If MsgBox("修改成功!", vbOKOnly, "恭喜") = vbOK Then
frmLogin.Show
Me.Hide
End If
Else
rs.MoveNext
i = i + 1
If i = j Then
MsgBox "原用户不存在或密码不一致!请确认!", vbOKOnly + vbCritical, "警告"
Combo1.SetFocus
Text1(0).Text = ""
Text1(1).Text = ""
Text1(2).Text = ""
Text1(3).Text = ""
Text1(4).Text = ""
Else
GoTo 1
End If
End If
Else
rs.MoveNext
i = i + 1
If i = j Then
MsgBox "原用户不存在或密码不一致!请确认!", vbOKOnly + vbCritical, "警告"
Combo1.SetFocus
Text1(0).Text = ""
Text1(1).Text = ""
Text1(2).Text = ""
Text1(3).Text = ""
Text1(4).Text = ""
Else
GoTo 2
End If
End If
Else
rs.MoveNext
i = i + 1
If i = j Then
MsgBox "原用户不存在或密码不一致!请确认!", vbOKOnly + vbCritical, "警告"
Combo1.SetFocus
Text1(0).Text = ""
Text1(1).Text = ""
Text1(2).Text = ""
Text1(3).Text = ""
Text1(4).Text = ""
Else
GoTo 3
End If
End If
End If
Else
MsgBox "请选择用户类别", vbCritical + vbOKOnly, "提示"
Combo1.SetFocus
End If
End Sub
Private Sub Command2_Click()
Dim i As Integer
For i = o To 4
Text1(i).Text = ""
Next i
Combo1.SetFocus
End Sub
Private Sub Command3_Click()
Unload Me
Form2.Show
Form21.Hide
End Sub
Private Sub Form_Load()
Unload frmLogin
MsgBox "进入修改用户资料界面以后,请先选择用户类别!", vbOKOnly + vbInformation, "信息提示"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -