?? frm_xgmm.frm
字號:
VERSION 5.00
Begin VB.Form FRM_XGMM
Caption = "修改密碼"
ClientHeight = 5535
ClientLeft = 4515
ClientTop = 2415
ClientWidth = 7575
Icon = "FRM_XGMM.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 5535
ScaleWidth = 7575
Begin VB.Data Data_XGMM
Caption = "Data_XGMM"
Connect = "Access 2000;"
DatabaseName = ""
DefaultCursorType= 0 '缺省游標(biāo)
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 1800
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 3840
Width = 2175
End
Begin VB.CommandButton cmdqx
Caption = "返回主窗體"
Height = 375
Left = 2520
TabIndex = 9
Top = 3120
Width = 1455
End
Begin VB.CommandButton cmdqd
Caption = "確定"
Default = -1 'True
Height = 375
Left = 600
TabIndex = 8
Top = 3120
Width = 1335
End
Begin VB.TextBox txts
Height = 270
IMEMode = 3 'DISABLE
Index = 3
Left = 1920
PasswordChar = "*"
TabIndex = 7
Text = "Text1"
Top = 2520
Width = 2055
End
Begin VB.TextBox txts
Height = 270
IMEMode = 3 'DISABLE
Index = 2
Left = 1920
PasswordChar = "*"
TabIndex = 6
Text = "Text1"
Top = 2040
Width = 2055
End
Begin VB.TextBox txts
Height = 270
IMEMode = 3 'DISABLE
Index = 1
Left = 1920
PasswordChar = "*"
TabIndex = 5
Text = "Text1"
Top = 1560
Width = 2055
End
Begin VB.TextBox txts
Height = 270
Index = 0
Left = 1920
TabIndex = 4
Text = "Text1"
Top = 1080
Width = 2055
End
Begin VB.Label Label5
Caption = "修改密碼"
BeginProperty Font
Name = "宋體"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 615
Left = 1440
TabIndex = 10
Top = 240
Width = 1935
End
Begin VB.Label Label4
Caption = "密碼確認(rèn)"
Height = 255
Left = 600
TabIndex = 3
Top = 2520
Width = 1095
End
Begin VB.Label Label3
Caption = "請輸入新密碼"
Height = 255
Left = 600
TabIndex = 2
Top = 2040
Width = 1095
End
Begin VB.Label Label2
Caption = "請輸入原密碼"
Height = 255
Left = 600
TabIndex = 1
Top = 1560
Width = 1095
End
Begin VB.Label Label1
Caption = "請輸入用戶名"
Height = 255
Left = 600
TabIndex = 0
Top = 1080
Width = 1215
End
End
Attribute VB_Name = "FRM_XGMM"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdqd_Click()
'將記錄集定位到所輸入的操作員
Data_XGMM.RecordSource = "select * from MIMA where 操作員 = '" & txts(0).Text & "'"
Data_XGMM.Refresh
If Data_XGMM.Recordset.RecordCount = 0 Then
'檢驗是否存在該操作員
MsgBox "查無此操作員!", vbCritical
ElseIf txts(1).Text = Data_XGMM.Recordset.Fields("密碼") Then '密碼正確
If txts(2).Text = txts(3).Text And txts(2).Text <> "" Then
'密碼正確且一致,則修改
Data_XGMM.Recordset.Edit
Data_XGMM.Recordset.Fields("密碼") = txts(2)
Data_XGMM.Recordset.Update
MsgBox "密碼修改成功!"
ElseIf txts(2).Text <> txts(3).Text Then
'密碼不一致
MsgBox "兩次輸入的密碼不一致,請檢驗!", vbOKOnly + vbInformation, "修改密碼"
ElseIf MsgBox("新密碼為空,是否使用空密碼!", vbYesNo) = vbYes Then
'新密碼為空
Data_XGMM.Recordset.Edit
Data_XGMM.Recordset.Fields("密碼") = txts(2)
Data_XGMM.Recordset.Update
MsgBox "密碼修改成功!"
Else
Exit Sub
End If
Else
'密碼不正確
MsgBox "密碼不正確,請核實后再嘗試!", vbCritical
End If
End Sub
Private Sub cmdqx_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim j As Integer
'連接數(shù)據(jù)庫,打開“密碼表”
Data_XGMM.DatabaseName = App.Path + "\" & P_BJ & "\student.mdb"
Data_XGMM.RecordSource = "MIMA"
Data_XGMM.Visible = False
'清空文本框
For j = 0 To 3
txts(j).Text = ""
Next j
End Sub
Private Sub Form_Unload(Cancel As Integer)
MAIN.Show
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -