?? frm_password.frm
字號:
VERSION 5.00
Begin VB.Form frm_password
BackColor = &H00C0FFC0&
Caption = "修改密碼"
ClientHeight = 3405
ClientLeft = 60
ClientTop = 345
ClientWidth = 4185
Icon = "frm_password.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3405
ScaleWidth = 4185
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2040
TabIndex = 7
Top = 2640
Width = 855
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 375
Left = 1200
TabIndex = 6
Top = 2640
Width = 855
End
Begin VB.TextBox Text3
Height = 375
IMEMode = 3 'DISABLE
Left = 2040
PasswordChar = "*"
TabIndex = 5
Top = 1800
Width = 1455
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 2040
PasswordChar = "*"
TabIndex = 4
Top = 1080
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 2040
PasswordChar = "*"
TabIndex = 3
Top = 360
Width = 1455
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "再輸入一遍:"
Height = 375
Left = 480
TabIndex = 2
Top = 1920
Width = 1215
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "新密碼:"
Height = 375
Left = 840
TabIndex = 1
Top = 1200
Width = 855
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "舊密碼:"
Height = 375
Left = 840
TabIndex = 0
Top = 480
Width = 975
End
End
Attribute VB_Name = "frm_password"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Mydb As New ADODB.Recordset
Dim Str_text As String
Private Sub Command1_Click()
On Error Resume Next
Dim Password As String
Dim Newpassword As String
Password = Text1.Text
Newpassword = Text2.Text
Set Mydb = ExeCutesql("SELECT pass from user1 WHERE user='" & Cname & "'", Str_text)
'MsgBox "select pass from user1 where user='" & Cname & "'"
If Not Password = Mydb.Fields(0) Then
MsgBox "原密碼輸入錯誤!", vbOKOnly + 32, "注意"
Text2.Text = ""
Text3.Text = ""
Text2.SetFocus
Else
If Text3.Text <> Newpassword Then
MsgBox "你兩次輸入密碼不一致,請重新輸入!", vbOKOnly + 32, "注意"
Text1.SetFocus
Else
ExeCutesql "UPDATE user1 SET pass= '" & Newpassword & "' where user='" & Cname & "'", ""
MsgBox "密碼更改成功!", vbOKOnly + 64, "注意"
Unload Me
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
frm_main.Show
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -