📄 frmsetpwd.frm
字号:
VERSION 5.00
Begin VB.Form frmSetPwd
BackColor = &H00C0FFC0&
BorderStyle = 1 'Fixed Single
Caption = "Form1"
ClientHeight = 4215
ClientLeft = 45
ClientTop = 435
ClientWidth = 6900
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4215
ScaleWidth = 6900
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox txtType
Alignment = 2 'Center
Height = 375
Left = 2400
Locked = -1 'True
TabIndex = 12
Top = 480
Width = 2655
End
Begin VB.CommandButton Command3
Caption = "取消"
Height = 375
Left = 4440
TabIndex = 10
Top = 3480
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "修改密码"
Height = 375
Left = 2880
TabIndex = 9
Top = 3480
Width = 1215
End
Begin VB.TextBox Text4
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 8
Top = 2760
Width = 2655
End
Begin VB.TextBox Text3
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 7
Top = 2160
Width = 2655
End
Begin VB.TextBox Text2
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 6
Top = 1560
Width = 2655
End
Begin VB.CommandButton Command1
Caption = "修改用户名"
Height = 375
Left = 1320
TabIndex = 5
Top = 3480
Width = 1215
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 375
Left = 2400
Locked = -1 'True
TabIndex = 1
Top = 960
Width = 2655
End
Begin VB.Label Label3
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "类型"
Height = 255
Left = 1440
TabIndex = 11
Top = 480
Width = 735
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "确认"
Height = 255
Index = 2
Left = 1440
TabIndex = 4
Top = 2880
Width = 735
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "新密码"
Height = 255
Index = 1
Left = 1440
TabIndex = 3
Top = 2280
Width = 735
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密码"
Height = 255
Index = 0
Left = 1440
TabIndex = 2
Top = 1680
Width = 735
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "用户名"
Height = 255
Left = 1440
TabIndex = 0
Top = 1080
Width = 735
End
End
Attribute VB_Name = "frmSetPwd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Sql As String
Dim RS As ADODB.Recordset
Private Sub Command1_Click()
'修改用户名
Me.Text1.Text = InputBox("请输入新的用户名(20字以内)", "提示")
Sql = "update 密码表 set 用户名='" & Trim(Me.Text1.Text)
Sql = Sql & "' where 用户名='" & Trim(mdiMain.Tag) & "'"
mdiMain.Caption = Replace(mdiMain.Caption, mdiMain.Tag, Me.Text1.Text)
mdiMain.Tag = Trim(Me.Text1.Text)
dbOperate Sql
End Sub
Private Sub Command2_Click()
'修改密码
Sql = "select 密码 from 密码表 where 用户名='" & Trim(Me.Text1.Text)
Sql = Sql & "' and 类型='" & Trim(Me.txtType.Text) & "'"
Set RS = dbSelect(Sql)
If Me.Text2.Text = RS.Fields(0) Then
If Me.Text3.Text = Me.Text4.Text Then
Sql = "update 密码表 set 密码='" & Me.Text3.Text
Sql = Sql & "' where 用户名='" & Trim(Me.Text1.Text)
Sql = Sql & "' and 类型='" & Trim(Me.txtType.Text) & "'"
dbOperate Sql
Else
MsgBox "新密码和确认密码不照!"
Me.Text3.SetFocus
End If
Else
MsgBox "原密码不正确!"
End If
End Sub
Private Sub Command3_Click()
'关闭
Unload Me
End Sub
Private Sub Form_Load()
Me.Text1.Text = mdiMain.Tag
Me.txtType.Text = Trim(Mid(mdiMain.Caption, 12, 5))
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -