?? chpwd.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form chpwd
BackColor = &H00404040&
BorderStyle = 3 'Fixed Dialog
Caption = "用戶修改密碼"
ClientHeight = 3060
ClientLeft = 45
ClientTop = 330
ClientWidth = 4680
Icon = "chpwd.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
Picture = "chpwd.frx":030A
ScaleHeight = 3060
ScaleWidth = 4680
ShowInTaskbar = 0 'False
Begin VB.PictureBox Picture2
Height = 1095
Left = 140
Picture = "chpwd.frx":59F9
ScaleHeight = 1035
ScaleWidth = 4335
TabIndex = 8
Top = 1440
Width = 4400
Begin VB.Label Label3
BackColor = &H00404040&
BackStyle = 0 'Transparent
Caption = " 密碼最多只能輸入20個英文字符或10個漢字或20個數字,不能輸入其它標點符號或怪字符。建議密碼不要使用漢字。"
ForeColor = &H00000000&
Height = 615
Left = 360
TabIndex = 9
Top = 240
Width = 3495
End
End
Begin VB.PictureBox Picture1
Height = 1155
Left = 140
Picture = "chpwd.frx":B0E8
ScaleHeight = 1095
ScaleWidth = 4335
TabIndex = 1
Top = 120
Width = 4400
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 270
IMEMode = 3 'DISABLE
Left = 960
PasswordChar = "*"
TabIndex = 5
Top = 240
Width = 1095
End
Begin VB.TextBox Text2
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 270
IMEMode = 3 'DISABLE
Left = 960
PasswordChar = "*"
TabIndex = 4
Top = 600
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "確定&(O)"
Height = 300
Left = 2880
TabIndex = 3
Top = 240
Width = 1000
End
Begin VB.CommandButton Command2
Caption = "取消&(C)"
Height = 300
Left = 2880
TabIndex = 2
Top = 600
Width = 1000
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00404040&
BackStyle = 0 'Transparent
Caption = "舊密碼:"
ForeColor = &H00000000&
Height = 180
Left = 240
TabIndex = 7
Top = 285
Width = 630
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00404040&
BackStyle = 0 'Transparent
Caption = "新密碼:"
ForeColor = &H00000000&
Height = 180
Left = 240
TabIndex = 6
Top = 645
Width = 630
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 360
Top = 2640
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.CommandButton Command3
Caption = "關閉&(Q)"
Height = 300
Left = 3450
TabIndex = 0
Top = 2670
Width = 1000
End
End
Attribute VB_Name = "chpwd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo err1
username = frmlogin.username
If Text1.Text <> "" And Text2.Text <> "" Then
Adodc1.RecordSource = "select * from usertab where 用戶名='" & username & "' and 密碼=" & "'" & Text1.Text & "'"
Adodc1.Refresh
If Adodc1.Recordset.AbsolutePosition = adPosUnknown Then
MsgBox "舊密碼錯誤!"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
Adodc1.Recordset.Fields("密碼") = Text2.Text
Adodc1.Recordset.Update
MsgBox "密碼修改成功!"
Text1.Text = ""
Text2.Text = ""
End If
Else
MsgBox "新舊密碼均不得為空!"
Text1.SetFocus
End If
Exit Sub
err1:
MsgBox "數據庫連接失敗!"
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error GoTo err2
chpwd.Top = (frmmain.Height - chpwd.Height) / 2 - 500
chpwd.Left = (frmmain.Width - chpwd.Width) / 2
Adodc1.ConnectionString = frmlogin.conn
Text1.Text = ""
Text2.Text = ""
Exit Sub
err2:
MsgBox "數據庫連接失敗!"
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmmain.StatusBar1.Panels(2) = "目前沒有窗口被激活"
End Sub
Private Sub Form_Activate()
frmmain.StatusBar1.Panels(2) = "活動窗口:" & chpwd.Caption
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -