?? frmchguserpasswd.frm
字號(hào):
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form FrmChgUserPasswd
BorderStyle = 3 'Fixed Dialog
Caption = "修改、查看用戶密碼"
ClientHeight = 3105
ClientLeft = 45
ClientTop = 330
ClientWidth = 4680
Icon = "FrmChgUserPasswd.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3105
ScaleWidth = 4680
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "關(guān)閉(&C)"
Height = 375
Left = 2760
TabIndex = 5
Top = 2400
Width = 975
End
Begin VB.CommandButton CmdChgPass
Caption = "修改(&D)"
Height = 375
Left = 960
TabIndex = 4
Top = 2400
Width = 975
End
Begin VB.TextBox TxtNewPasswdC
Height = 390
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 3
Top = 1680
Width = 3015
End
Begin VB.TextBox TxtNewPasswd
Height = 390
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 2
Top = 1200
Width = 3015
End
Begin VB.TextBox TxtPasswd
Height = 390
IMEMode = 3 'DISABLE
Left = 1440
TabIndex = 1
Top = 720
Width = 3015
End
Begin VB.TextBox TxtUserID
Height = 390
Left = 1440
TabIndex = 0
Top = 240
Width = 3015
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 0
Top = 2040
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "確認(rèn)密碼:"
Height = 180
Left = 360
TabIndex = 9
Top = 1800
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "新密碼:"
Height = 180
Left = 540
TabIndex = 8
Top = 1320
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "查看舊密碼:"
Height = 180
Left = 180
TabIndex = 7
Top = 840
Width = 1080
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "用戶帳號(hào):"
Height = 180
Left = 360
TabIndex = 6
Top = 360
Width = 900
End
End
Attribute VB_Name = "FrmChgUserPasswd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdChgPass_Click()
On Error GoTo errEnd
If TxtUserID.Text = "" Then
MsgBox "請輸入用戶的帳號(hào)!", vbOKOnly + vbExclamation, "更改密碼"
TxtUserID.SetFocus
Exit Sub
End If
If TxtNewPasswd.Text = "" Then
MsgBox "請輸入用戶的新密碼!", vbOKOnly + vbExclamation, "更改密碼"
TxtNewPasswd.SetFocus
Exit Sub
End If
If TxtNewPasswd.Text <> TxtNewPasswdC.Text Then
MsgBox "密碼輸入不一致,請重試!", vbOKOnly + vbExclamation, "更改密碼"
TxtPasswd.Text = ""
TxtNewPasswd.Text = ""
TxtNewPasswdC.Text = ""
TxtPasswd.SetFocus
Exit Sub
End If
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from [Admin] where [用戶ID]=""" & TxtUserID.Text & """"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
Adodc1.Recordset!用戶密碼 = TxtNewPasswd.Text
Adodc1.Recordset.Update
Else
MsgBox "該用戶不存在!無法修改密碼!", vbOKOnly + vbExclamation, "密碼錯(cuò)誤"
TxtPasswd.Text = ""
TxtNewPasswd.Text = ""
TxtNewPasswdC.Text = ""
Exit Sub
End If
MsgBox "用戶密碼修改成功!請牢記!", vbOKOnly + vbInformation, "更改密碼"
TxtPasswd.Text = ""
TxtNewPasswd.Text = ""
TxtNewPasswdC.Text = ""
Exit Sub
errEnd:
MsgBox Err.Description & vbCrLf & "更改密碼失敗!", vbOKOnly + vbExclamation, "操作數(shù)據(jù)庫出錯(cuò)"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim dbName As String
Dim connSTR As String
On Error GoTo errEnd
dbName = App.Path
If Right(dbName, 1) <> "\" Then dbName = dbName + "\"
dbName = dbName + "DataBase\WFSSDataBase.mdb"
connSTR = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbName & ";Persist Security Info=False"
Adodc1.ConnectionString = connSTR
Exit Sub
errEnd:
MsgBox Err.Description, vbOKOnly + vbExclamation, "打開數(shù)據(jù)庫出錯(cuò)"
End Sub
Private Sub TxtPasswd_Click()
Dim ret As Integer
On Error GoTo errEnd
If TxtUserID.Text <> "" Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select [用戶密碼] from [Admin] where [用戶ID]=""" & TxtUserID.Text & """"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
TxtPasswd.Text = Adodc1.Recordset!用戶密碼
Else
ret = MsgBox("該用戶帳號(hào)不存在!", vbOKCancel + vbInformation, "更改用戶密碼")
If ret = vbOK Then
TxtUserID.SetFocus
TxtUserID.SelStart = 0
TxtUserID.SelLength = Len(TxtUserID.Text)
Else
Unload Me
End If
End If
End If
Exit Sub
errEnd:
MsgBox Err.Description, vbOKOnly + vbExclamation, "打開數(shù)據(jù)庫出錯(cuò)"
End Sub
Private Sub TxtUserID_LostFocus()
Call TxtPasswd_Click
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -