📄 form4.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form4
BackColor = &H00FFC0C0&
BorderStyle = 1 'Fixed Single
Caption = "当前操作用户密码更改"
ClientHeight = 4065
ClientLeft = 45
ClientTop = 330
ClientWidth = 6060
LinkTopic = "Form4"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4065
ScaleWidth = 6060
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text4
DataField = "密码"
DataSource = "Adodc1"
Height = 480
Left = 3090
TabIndex = 9
Text = "Text4"
Top = 4365
Width = 2880
End
Begin MSAdodcLib.Adodc Adodc1
Height = 750
Left = 1110
Top = 4800
Width = 1500
_ExtentX = 2646
_ExtentY = 1323
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=test;Data Source=(local)"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=test;Data Source=(local)"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from table1_user"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command2
BackColor = &H00FFFF80&
Cancel = -1 'True
Caption = "返回(&E)"
Height = 450
Left = 2850
Style = 1 'Graphical
TabIndex = 8
Top = 2745
Width = 1170
End
Begin VB.CommandButton Command1
BackColor = &H00FFFF80&
Caption = "确认(&A)"
Default = -1 'True
Height = 450
Left = 840
Style = 1 'Graphical
TabIndex = 7
Top = 2745
Width = 1170
End
Begin VB.TextBox Text3
BackColor = &H00FFC0FF&
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
IMEMode = 3 'DISABLE
Left = 2040
PasswordChar = "*"
TabIndex = 6
Top = 1785
Width = 2130
End
Begin VB.TextBox Text2
BackColor = &H00FFC0FF&
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
IMEMode = 3 'DISABLE
Left = 2040
PasswordChar = "*"
TabIndex = 5
Top = 1245
Width = 2130
End
Begin VB.TextBox Text1
BackColor = &H00FFC0FF&
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
IMEMode = 3 'DISABLE
Left = 2040
PasswordChar = "*"
TabIndex = 4
Top = 750
Width = 2130
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Height = 2265
Left = 390
TabIndex = 0
Top = 240
Width = 4350
Begin VB.Label Label3
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "确认新密码"
Height = 420
Left = 300
TabIndex = 3
Top = 1590
Width = 1080
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "输入新密码"
Height = 420
Left = 315
TabIndex = 2
Top = 1050
Width = 1080
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "输入旧密码"
Height = 300
Left = 330
TabIndex = 1
Top = 540
Width = 1080
End
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click() '可改为在用户刚输完旧密码时便做出判断
Call main
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
MsgBox "输入不能为空!!", 64, "用户管理系统"
Else
Adodc1.RecordSource = "select * from Table1_user where 帐号 ='" & Form1.Text1.Text & "'"
Adodc1.Refresh
If Trim(Text4.Text) = Trim(Text1.Text) Then
If Text2.Text <> Text3.Text Then
MsgBox "两次输入的密码不一致,请您确认后重新输入", 64, "用户管理系统"
Text2.Text = ""
Text3.Text = ""
Text2.SetFocus
Else
Set adoRs = adoCon.Execute("UPDATE Table1_user SET 密码= '" + Text3.Text + "' where 帐号='" + Form1.Text1.Text + "'")
Adodc1.Refresh
MsgBox "密码修改成功,请您记住新密码", 64, "用户管理系统"
Unload Me
End If
Else
MsgBox "旧密码错误,请您确认后重新输入", 64, "用户管理系统"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
End If
End If
adoCon.Close
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text2.SetFocus
Else
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text3.SetFocus
Else
End If
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call Command1_Click
Else
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -