?? modpassword.frm
字號:
VERSION 5.00
Begin VB.Form modPassword
BorderStyle = 1 'Fixed Single
Caption = "修改密碼"
ClientHeight = 2970
ClientLeft = 45
ClientTop = 330
ClientWidth = 4185
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 2970
ScaleWidth = 4185
Begin VB.CommandButton Command2
Caption = "取消(&C)"
Height = 375
Left = 2400
TabIndex = 8
Top = 2400
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "修改密碼(&U)"
Height = 375
Left = 360
TabIndex = 7
Top = 2400
Width = 1215
End
Begin VB.Frame Frame1
Caption = "修改密碼"
Height = 2055
Left = 120
TabIndex = 0
Top = 120
Width = 3855
Begin VB.TextBox Text3
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 3
ToolTipText = "再次輸入新密碼進(jìn)行核對"
Top = 1440
Width = 1695
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 2
ToolTipText = "輸入新密碼"
Top = 960
Width = 1695
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1800
TabIndex = 1
ToolTipText = "登錄系統(tǒng)用戶的用戶名"
Top = 480
Width = 1695
End
Begin VB.Label Label3
Caption = "再次輸入密碼:"
Height = 255
Left = 360
TabIndex = 6
Top = 1440
Width = 1335
End
Begin VB.Label Label2
Caption = "請輸入新密碼:"
Height = 255
Left = 360
TabIndex = 5
Top = 960
Width = 1335
End
Begin VB.Label Label1
Caption = "您的用戶名為:"
Height = 255
Left = 360
TabIndex = 4
Top = 480
Width = 1335
End
End
End
Attribute VB_Name = "modPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim txtSQL As String
Dim MsgText As String
Dim MRC As ADODB.Recordset
If (Text2.Text = "") Then
If (Text3.Text <> "") Then
MsgBox "輸入的新密碼不能為空!", vbOKOnly + vbApplicationModal, "成績管理系統(tǒng)"
Text3.Text = ""
Text2.SetFocus
Else
MsgBox "輸入的新密碼不能為空!", vbOKOnly + vbApplicationModal, "成績管理系統(tǒng)"
Text2.SetFocus
End If
Else
If ((Text2.Text <> Text3.Text) And (Text3.Text <> "")) Then
MsgBox "兩次輸入的密碼不一致!", vbOKOnly + vbApplicationModal, "成績管理系統(tǒng)"
Text3.SetFocus
Text3.Text = ""
ElseIf ((Text2.Text <> Text3.Text) And (Text3.Text = "")) Then
MsgBox "再次輸入的新密碼不能為空!", vbOKOnly + vbApplicationModal, "成績管理系統(tǒng)"
Text3.SetFocus
Text3.Text = ""
Else
'---------------------------------使用UPDATE語句進(jìn)行修改密碼處理----------------------------------
txtSQL = "UPDATE userLogin SET password='" & Trim(Text2.Text) & "' WHERE username='" & Trim(Text1.Text) & "'"
Set MRC = ExecuteSQL(txtSQL, MsgText)
If (MsgText = "UPDATE query successful") Then
MsgBox "密碼修改成功!", vbOKOnly + vbInformation, "成績管理系統(tǒng)"
Else
MsgBox "'" + MsgText + "'", vbOKOnly + vbCritical, "警告"
End If
Text2.Text = ""
Text3.Text = ""
Unload Me
End If
'--------------------------------------------------------------------------------------
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Move (frmMain.ScaleWidth - Me.Width) / 2, (frmMain.ScaleHeight - Me.Height) / 2
Me.Text1.Text = frmLogin.txtusername.Text
Me.Text1.Enabled = False
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -