?? editpas.frm
字號:
VERSION 5.00
Begin VB.Form EditPas
BorderStyle = 1 'Fixed Single
Caption = "修改密碼"
ClientHeight = 3645
ClientLeft = 45
ClientTop = 435
ClientWidth = 3720
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3645
ScaleWidth = 3720
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "關閉(&C)"
Height = 375
Left = 2520
TabIndex = 6
Top = 3120
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "修改(&E)"
Height = 375
Left = 1320
TabIndex = 5
Top = 3120
Width = 1095
End
Begin VB.Frame Frame1
Caption = "修改"
Height = 2895
Left = 120
TabIndex = 0
Top = 120
Width = 3495
Begin VB.TextBox Text4
Appearance = 0 'Flat
BackColor = &H00C0FFFF&
Height = 375
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 2
Top = 960
Width = 1935
End
Begin VB.TextBox Text3
Appearance = 0 'Flat
BackColor = &H00C0FFFF&
Height = 375
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 4
Top = 2160
Width = 1935
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
BackColor = &H00C0FFFF&
Height = 375
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 3
Top = 1560
Width = 1935
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BackColor = &H00C0FFFF&
Height = 375
Left = 1200
TabIndex = 1
Top = 360
Width = 1935
End
Begin VB.Line Line1
X1 = 0
X2 = 3480
Y1 = 1440
Y2 = 1440
End
Begin VB.Label Label4
Caption = "舊密碼:"
Height = 255
Left = 240
TabIndex = 10
Top = 1080
Width = 735
End
Begin VB.Label Label3
Caption = "確認密碼:"
Height = 375
Left = 240
TabIndex = 9
Top = 2280
Width = 975
End
Begin VB.Label Label2
Caption = "新密碼:"
Height = 255
Left = 240
TabIndex = 8
Top = 1680
Width = 855
End
Begin VB.Label Label1
Caption = "用戶名:"
Height = 255
Left = 240
TabIndex = 7
Top = 480
Width = 735
End
End
End
Attribute VB_Name = "EditPas"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim SQL As String
If Text1.Text = "" Then
MsgBox "對不起,用戶名必須填寫", vbInformation + vbOKOnly, "警告"
Text1.SetFocus
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "對不起,密碼必須填寫", vbInformation + vbOKOnly, "警告"
Text2.SetFocus
Exit Sub
End If
If Text3.Text = "" Then
MsgBox "對不起,密碼確認必須填寫", vbInformation + vbOKOnly, "警告"
Text3.SetFocus
Exit Sub
End If
If Text4.Text = "" Then
MsgBox "對不起,密碼必須填寫", vbInformation + vbOKOnly, "警告"
Text4.SetFocus
Exit Sub
End If
If Text2.Text <> Text3.Text Then
MsgBox "對不起,兩次密碼輸入不一致,請重新輸入", vbInformation + vbOKOnly, "警告"
Text2.Text = ""
Text3.Text = ""
Text2.SetFocus
Exit Sub
End If
SQL = "select * from usetable where 用戶=""" & Text1.Text & """"
OpenDBFile
OpenRS (SQL)
If Not gRst.EOF Then
If Text4.Text <> gRst("密碼") Then
CloseRS
MsgBox "對不起,你的密碼錯誤,請重新輸入!", vbInformation + vbOKOnly, "警告"
Text4.Text = ""
Text4.SetFocus
Exit Sub
End If
CloseRS
SQL = "update usetable set 密碼=""" & Text2.Text & """ where 用戶=""" & Text1.Text & """"
OpenDBFile
gCon.Execute SQL
CloseDBFile
MsgBox "密碼修改成功!", vbInformation + vbOKOnly, "提示"
Else
MsgBox "對不起,用戶名錯誤,請重新輸入!", vbInformation + vbOKOnly, "警告"
Text1.Text = ""
Text1.SetFocus
CloseRS
Exit Sub
End If
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -