?? main密碼修改.frm
字號:
VERSION 5.00
Begin VB.Form main密碼修改
Caption = "密碼修改"
ClientHeight = 2775
ClientLeft = 60
ClientTop = 405
ClientWidth = 3630
LinkTopic = "Form2"
ScaleHeight = 2775
ScaleWidth = 3630
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
BackColor = &H00FF8080&
Caption = "確定"
Height = 405
Left = 120
TabIndex = 7
Top = 2265
Width = 1575
End
Begin VB.TextBox Text1
BackColor = &H00FFC0C0&
Height = 300
IMEMode = 3 'DISABLE
Left = 960
TabIndex = 6
Top = 750
Width = 2340
End
Begin VB.TextBox Text2
BackColor = &H00FFC0C0&
Height = 300
IMEMode = 3 'DISABLE
Left = 960
PasswordChar = "*"
TabIndex = 5
Top = 1200
Width = 2340
End
Begin VB.TextBox Text3
BackColor = &H00FFC0C0&
Height = 300
IMEMode = 3 'DISABLE
Left = 960
PasswordChar = "*"
TabIndex = 4
Top = 1575
Width = 2340
End
Begin VB.CommandButton Command2
BackColor = &H00FF8080&
Caption = "退出"
Height = 405
Left = 1800
TabIndex = 3
Top = 2265
Width = 1575
End
Begin VB.Frame Frame1
Caption = "Frame1"
Height = 1320
Left = 1080
TabIndex = 0
Top = 2790
Visible = 0 'False
Width = 1425
Begin VB.TextBox ma
DataField = "密碼"
DataSource = "Data1"
Height = 270
Left = 75
TabIndex = 2
Top = 480
Width = 1140
End
Begin VB.TextBox czy
DataField = "用戶名稱"
DataSource = "Data1"
Height = 270
Left = 75
TabIndex = 1
Top = 195
Width = 1140
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "D:\桌面\新建文件夾\db2.mdb"
DefaultCursorType= 0 '缺省游標(biāo)
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 195
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "用戶管理表"
Top = 855
Visible = 0 'False
Width = 1140
End
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "請輸入操作員代號、原密碼和新密碼"
Height = 360
Left = 255
TabIndex = 11
Top = 240
Width = 2985
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "用戶名"
Height = 255
Left = 120
TabIndex = 10
Top = 810
Width = 645
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "源密碼"
Height = 255
Left = 120
TabIndex = 9
Top = 1230
Width = 735
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "新密碼"
Height = 255
Left = 120
TabIndex = 8
Top = 1665
Width = 735
End
End
Attribute VB_Name = "main密碼修改"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
frm主窗體.StatusBar1.Panels(1) = Me.Caption
Data1.DatabaseName = App.Path & "\db2.mdb"
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm主窗體.Enabled = True
frm主窗體.StatusBar1.Panels(1) = "楊揚工作室 作者:小楊"
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
Text2.SetFocus
End If
If KeyCode = vbKeyDown Then
Data1.RecordSource = "select * from 用戶管理表 where (用戶管理表.用戶名稱 like '%" + Text1.Text + "%')"
Data1.Refresh
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
Text3.SetFocus
End If
If KeyCode = vbKeyUp Then
Text1.SetFocus
End If
If KeyCode = vbKeyDown Then
Data1.RecordSource = "select * from 用戶管理表 where (用戶管理表.密碼 like '%" + Text2.Text + "%')"
Data1.Refresh
Text3.SetFocus
End If
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
Command1.SetFocus
End If
If KeyCode = vbKeyUp Then
Text2.SetFocus
End If
If KeyCode = vbKeyDown Then
Command1.SetFocus
End If
End Sub
Private Sub Command1_Click()
Call main
Dim MESSAGE As String
Data1.RecordSource = "select * from 用戶管理表 where (用戶管理表.用戶名稱='" + Text1.Text + "' and 用戶管理表.密碼='" + Text2.Text + "')"
Data1.Refresh
If Data1.Recordset.RecordCount > 0 Then
Set adoRs = adoCon.Execute("update 用戶管理表 set 密碼='" + Text3.Text + "' where 用戶名稱='" + Text1.Text + "'")
MsgBox "密碼修改成功!", , "信息提示"
Else
MsgBox "沒有要修改的相關(guān)信息!", , "信息提示"
End If
adoCon.Close
End Sub
Private Sub Command2_Click()
frm主窗體.Enabled = True
Unload Me
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -