📄 更改登陆口令.frm
字号:
VERSION 5.00
Begin VB.Form frmChange
'Download by http://www.codefans.net
BorderStyle = 1 'Fixed Single
Caption = "更改口令"
ClientHeight = 3465
ClientLeft = 45
ClientTop = 330
ClientWidth = 5460
Icon = "更改登陆口令.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
Picture = "更改登陆口令.frx":0442
ScaleHeight = 3465
ScaleWidth = 5460
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Left = 2400
TabIndex = 0
Top = 960
Width = 2055
End
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "取消&C"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3720
TabIndex = 5
Top = 2880
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确定&O"
Default = -1 'True
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2040
TabIndex = 4
Top = 2880
Width = 1215
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 3
Top = 2040
Width = 2055
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 1
Top = 1500
Width = 2055
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户名:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 480
TabIndex = 8
Top = 960
Width = 1260
End
Begin VB.Line Line2
BorderWidth = 2
X1 = 0
X2 = 5400
Y1 = 2640
Y2 = 2640
End
Begin VB.Line Line1
BorderWidth = 2
X1 = 0
X2 = 5400
Y1 = 720
Y2 = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "设定登陆口令"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 600
TabIndex = 7
Top = 240
Width = 1980
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "确认口令:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 480
TabIndex = 6
Top = 2040
Width = 1575
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "新口令:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 480
TabIndex = 2
Top = 1500
Width = 1260
End
End
Attribute VB_Name = "frmChange"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim RS As Recordset
Dim sql As String
Private Sub Command1_Click()
On Error GoTo updata
If Text3 = "" Then
MsgBox "请输入用户名"
Text3.SetFocus
Exit Sub
End If
sql = "select * from 登陆 where 用户名='" & Text3.Text & "'"
Set RS = Db.OpenRecordset(sql)
If RS.EOF Then
MsgBox "用户名不存在,请输入正确的用户名"
Exit Sub
End If
If Text1 = Text2 Then
RS.Edit
RS.Fields("密码").Value = Text1
RS.Update
MsgBox "用户密码已更改成功"
Unload Me
Else
MsgBox "两次输入不同,请重新输入"
Text1.SetFocus
End If
Exit Sub
updata:
If err.Number = 3315 Then
MsgBox "登陆口令长度不能为零"
Text1.SetFocus
End If
Exit Sub
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Top = MDIForm1.Top + 1200
Me.Left = MDIForm1.Left + 1800
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -