📄 user2.frm
字号:
VERSION 5.00
Begin VB.Form frmuser2
BackColor = &H00E0E0E0&
Caption = "修改密码"
ClientHeight = 4185
ClientLeft = 60
ClientTop = 450
ClientWidth = 6000
Icon = "user2.frx":0000
LinkTopic = "Form2"
ScaleHeight = 4185
ScaleWidth = 6000
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3720
TabIndex = 4
Top = 3120
Width = 975
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 1080
TabIndex = 3
Top = 3120
Width = 975
End
Begin VB.TextBox Text3
Height = 375
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 2
Top = 2280
Width = 1935
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 1
Top = 1560
Width = 1935
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
Height = 375
Left = 2280
TabIndex = 0
Top = 840
Width = 1935
End
Begin VB.Label Label3
Caption = "密码确认:"
Height = 375
Left = 1080
TabIndex = 7
Top = 2280
Width = 1095
End
Begin VB.Label Label2
Caption = "新密码:"
Height = 375
Left = 1200
TabIndex = 6
Top = 1560
Width = 855
End
Begin VB.Label Label1
Caption = "用户名:"
Height = 375
Left = 1200
TabIndex = 5
Top = 840
Width = 975
End
End
Attribute VB_Name = "frmuser2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim mrc As ADODB.Recordset
txtsql = "select username from use where username='" & Trim(Text1.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = True Then
MsgBox " 用户名错误!", vbExclamation + vbOKOnly, "警告"
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Exit Sub
End If
username = mrc.Fields(0)
txtsql = "select username from use where password='" & Trim(Text2.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If Trim(Text1.Text) = "" Then
MsgBox "用户名不能为空!", vbExclamation + vbOKOnly, "警告"
Text1.SetFocus
Exit Sub
End If
If Trim(Text2.Text) = "" Then
MsgBox "密码不能为空!", vbExclamation + vbOKOnly, "警告"
Text2.SetFocus
Exit Sub
End If
If Trim(Text3.Text) = "" Then
MsgBox "确认密码不能为空!", vbExclamation + vbOKOnly, "警告"
Text13.SetFocus
Exit Sub
End If
If Trim(Text2.Text) <> Trim(Text3.Text) Then
MsgBox "确认密码不正确!", vbExclamation + vbOKOnly, "警告"
Text3.SetFocus
Exit Sub
End If
MsgBox " 用户添加成功!", vbExclamation + vbOKOnly, "警告"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
MDIForm1.Show
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -