?? frmchghypasswd.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form FrmChgHYPasswd
BorderStyle = 3 'Fixed Dialog
Caption = "修改、查看會員密碼"
ClientHeight = 3060
ClientLeft = 45
ClientTop = 330
ClientWidth = 4755
Icon = "FrmChgHYPasswd.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3060
ScaleWidth = 4755
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox TxtUserID
Height = 390
Left = 1560
TabIndex = 0
Top = 240
Width = 3015
End
Begin VB.TextBox TxtPasswd
Height = 390
IMEMode = 3 'DISABLE
Left = 1560
TabIndex = 1
Top = 720
Width = 3015
End
Begin VB.TextBox TxtNewPasswd
Height = 390
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 2
Top = 1200
Width = 3015
End
Begin VB.TextBox TxtNewPasswdC
Height = 390
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 3
Top = 1680
Width = 3015
End
Begin VB.CommandButton CmdChgPass
Caption = "修改(&D)"
Height = 375
Left = 1080
TabIndex = 4
Top = 2400
Width = 975
End
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "關閉(&C)"
Height = 375
Left = 2880
TabIndex = 5
Top = 2400
Width = 975
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 120
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 Label1
AutoSize = -1 'True
Caption = "會員帳(卡)號:"
Height = 180
Left = 120
TabIndex = 9
Top = 360
Width = 1260
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "查看舊密碼:"
Height = 180
Left = 300
TabIndex = 8
Top = 840
Width = 1080
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "新密碼:"
Height = 180
Left = 660
TabIndex = 7
Top = 1320
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "確認密碼:"
Height = 180
Left = 480
TabIndex = 6
Top = 1800
Width = 900
End
End
Attribute VB_Name = "FrmChgHYPasswd"
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 "請輸入會員的帳號!", 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 [用戶身份]='會員' and [用戶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, "密碼錯誤"
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ù)庫出錯"
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ù)庫出錯"
End Sub
Private Sub TxtUserID_LostFocus()
Dim ret As Integer
On Error GoTo errEnd
If TxtUserID.Text <> "" Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select [用戶密碼] from [Admin] where [用戶身份]='會員' and [用戶ID]=""" & TxtUserID.Text & """"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
TxtPasswd.Text = Adodc1.Recordset!用戶密碼
Else
ret = MsgBox("該會員帳號不存在!", 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ù)庫出錯"
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -