📄 form8.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form8
BorderStyle = 1 'Fixed Single
Caption = "密码修改"
ClientHeight = 3435
ClientLeft = 45
ClientTop = 330
ClientWidth = 3135
Icon = "Form8.frx":0000
LinkTopic = "Form8"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3435
ScaleWidth = 3135
Begin VB.ComboBox Combo1
DataField = "用户名"
DataSource = "Adodc1"
Height = 300
ItemData = "Form8.frx":08CA
Left = 1560
List = "Form8.frx":08CC
TabIndex = 9
Text = "Combo1"
Top = 360
Width = 1095
End
Begin MSAdodcLib.Adodc Adodc1
Height = 735
Left = 720
Top = 3000
Width = 2055
_ExtentX = 3625
_ExtentY = 1296
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 Command2
Caption = "取 消"
Height = 375
Left = 1680
TabIndex = 8
Top = 1920
Width = 975
End
Begin VB.CommandButton Command1
Caption = "确 认"
Height = 375
Left = 240
TabIndex = 7
Top = 1920
Width = 975
End
Begin VB.TextBox Text4
Height = 270
IMEMode = 3 'DISABLE
Left = 1560
MaxLength = 8
PasswordChar = "*"
TabIndex = 6
Top = 1440
Width = 1095
End
Begin VB.TextBox Text3
Height = 270
IMEMode = 3 'DISABLE
Left = 1560
MaxLength = 8
PasswordChar = "*"
TabIndex = 5
Top = 1080
Width = 1095
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 3 'DISABLE
Left = 1560
MaxLength = 8
PasswordChar = "*"
TabIndex = 2
Top = 720
Width = 1095
End
Begin VB.Label Label4
Caption = "请确认新密码:"
Height = 255
Left = 240
TabIndex = 4
Top = 1440
Width = 1335
End
Begin VB.Label Label3
Caption = "请输入新密码:"
Height = 255
Left = 240
TabIndex = 3
Top = 1080
Width = 1335
End
Begin VB.Label Label2
Caption = "请输入旧密码:"
Height = 255
Left = 240
TabIndex = 1
Top = 720
Width = 1455
End
Begin VB.Label Label1
Caption = "请输入用户名:"
Height = 255
Left = 240
TabIndex = 0
Top = 360
Width = 1335
End
End
Attribute VB_Name = "Form8"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'欢迎你下载使用本代码,本份代码由程序太平洋提供下载学习之用
'声明:
'1.本站所有代码的版权归原作者所有,如果你使用了在本站下载的源代码
' 引起的一切纠纷(后果)与本站无关,请您尊重原作者的劳动成果!
'2.若本站在代码上有侵权之处请您与站长联系,站长会及时更正。
'网站:http://www.dapha.net
'论坛:http://www.5ivb.net
'Email:dapha@etang.com
'CopyRight 2001-2005 By dapha.net
'整理时间:2003-8-16 12:44:01
Private Sub Command1_Click()
Dim StrUser As String
Dim StrPassWord As String
Adodc1.Recordset.MoveFirst
StrUser = Adodc1.Recordset("用户名")
StrPassWord = Adodc1.Recordset("用户密码")
If Me.Combo1.Text = "" Then
MsgBox "请输入用户名!", vbOKOnly + 48, "金恒生计算机硬件公司管理系统"
Exit Sub
End If
While Not (Adodc1.Recordset.EOF)
If Me.Combo1.Text <> StrUser Then
Me.Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
Me.Text2.Text = ""
Me.Text3.Text = ""
Me.Text4.Text = ""
Me.Combo1.SetFocus
MsgBox "用户名或密码错误!", vbOKOnly + 16, "金恒生计算机硬件公司管理系统"
Exit Sub
End If
StrUser = Adodc1.Recordset("用户名")
StrPassWord = Adodc1.Recordset("用户密码")
Else
'Me.Label3.Caption = StrUser
If Me.Text2.Text <> StrPassWord Then
Me.Text2.Text = ""
Me.Text3.Text = ""
Me.Text4.Text = ""
Me.Combo1.SetFocus
MsgBox "用户名或密码错误!", vbOKOnly + 16, "金恒生计算机硬件公司管理系统"
Exit Sub
End If
If Me.Text2.Text = StrPassWord Then
If Me.Text3.Text = Me.Text4.Text Then
Me.Adodc1.Recordset.Fields("用户密码") = Me.Text3.Text
Me.Adodc1.Recordset.Update
Me.Text2.Text = ""
Me.Text3.Text = ""
Me.Text4.Text = ""
MsgBox "用户密码已修改!", vbOKOnly + 48, "金恒生计算机硬件公司管理系统"
Else
Me.Text3.Text = ""
Me.Text4.Text = ""
Me.Text3.SetFocus
MsgBox "请再次确认您的新密码!", vbOKOnly + 48, "金恒生计算机硬件公司管理系统"
End If
Exit Sub
End If
End If
Wend
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim Str, strNa As String '定义
Dim StrConnect As String
StrConnect = App.Path
If Right(StrConnect, 1) <> "\" Then StrConnect = StrConnect + "\"
StrConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & StrConnect & "\data\kji.bgh"
Adodc1.ConnectionString = StrConnect
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM [user]"
Adodc1.Refresh
Me.Top = 0
Me.Left = 0
Me.Height = 3000
Me.Width = 3000
If str1 = "普通用户" Then
Me.Combo1.Enabled = False
Me.Text2.SetFocus
End If
While Not (Adodc1.Recordset.EOF)
strNa = Me.Adodc1.Recordset("用户名")
Me.Combo1.AddItem strNa
Me.Adodc1.Recordset("用户名") = strNa
Me.Adodc1.Recordset.MoveNext
Wend
Me.Combo1.Text = User1
Me.Adodc1.Visible = False
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Command1_Click
End Sub
'统计结果:
' 注释共:2行
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -