?? frmpwupdate.frm
字號:
VERSION 5.00
Begin VB.Form frmPWupdate
BorderStyle = 1 'Fixed Single
Caption = "用戶密碼修改"
ClientHeight = 3270
ClientLeft = 4725
ClientTop = 4740
ClientWidth = 5385
Icon = "frmPWupdate.frx":0000
LinkTopic = "Form3"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3270
ScaleWidth = 5385
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游標
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = 4080
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "密碼表"
Top = 240
Visible = 0 'False
Width = 1140
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 3240
TabIndex = 7
Top = 2640
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 495
Left = 840
TabIndex = 6
Top = 2640
Width = 1215
End
Begin VB.TextBox Text3
Height = 270
Left = 1920
TabIndex = 5
Top = 2040
Width = 1815
End
Begin VB.TextBox Text2
Height = 270
Left = 1920
TabIndex = 4
Top = 1440
Width = 1815
End
Begin VB.TextBox Text1
Height = 270
Left = 1920
TabIndex = 3
Top = 840
Width = 1815
End
Begin VB.Label Label5
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1920
TabIndex = 9
Top = 240
Width = 1215
End
Begin VB.Label Label4
Caption = "確認新密碼"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 8
Top = 2040
Width = 1215
End
Begin VB.Label Label3
Caption = "新密碼"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 2
Top = 1440
Width = 1215
End
Begin VB.Label Label2
Caption = "原密碼"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 1
Top = 840
Width = 1215
End
Begin VB.Label Label1
Caption = "當前用戶"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 0
Top = 240
Width = 1215
End
End
Attribute VB_Name = "frmPWupdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim myheight, mywidth As Integer '保持窗體大小的相關聲明
Private Sub Command1_Click()
If Text1.Text = "" And Text2.Text = "" And Text3.Text = "" Then '密碼更新檢測
MsgBox "你沒有輸入更新信息!", , "提示"
Else
If Text1.Text = "" Then
MsgBox "請輸入原密碼!", , "提示"
Else
If Text2.Text = "" Then
MsgBox "請輸入新密碼!", , "提示"
Else
If Text3.Text = "" Then
MsgBox "請確認你的新密碼!", , "提示"
Else
If Text2.Text <> Text3.Text Then
MsgBox "你兩次輸入的密碼不同,請重新輸入!", , "提示"
Text2.Text = ""
Text3.Text = ""
Text2.SetFocus
Else
Dim password As String
password = "password=" & "'" & Trim(Text1.Text) & "'"
Data1.Recordset.FindFirst password
If Data1.Recordset.NoMatch Then
MsgBox "你輸入的原密碼有誤!", , "提示"
Else
Data1.Recordset.AddNew
Data1.Recordset.Fields("useid") = Label5.Caption
Data1.Recordset.Fields("password") = Text2.Text
Data1.Recordset.Update
Data1.Recordset.Delete
MsgBox "你已經成功的更換了新密碼,請使用新密碼!", , "提示"
End If
End If
End If
End If
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
mywidth = Me.Width '保持窗體大小
myheight = Me.Height
Data1.DatabaseName = App.Path + "\水電費管理系統數據庫.mdb"
Data1.RecordSource = "密碼表"
End Sub
Private Sub Form_Resize()
Me.Height = myheight '保持窗體大小
Me.Width = mywidth
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then SendKeys "{tab}" '原密碼框中按回車,焦點下移
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then SendKeys "{tab}" '新密碼框中按回車,焦點下移
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Command1_Click '此框中按回車,等同于按"確定"按鈕
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -