📄 frmup.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmup
BorderStyle = 3 'Fixed Dialog
Caption = "密码设置"
ClientHeight = 2805
ClientLeft = 45
ClientTop = 330
ClientWidth = 5145
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2805
ScaleWidth = 5145
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 240
Top = 3720
Visible = 0 'False
Width = 1575
_ExtentX = 2778
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=tsgl"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=tsgl"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from usertb"
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 = 3840
TabIndex = 8
Top = 2400
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确 定"
Height = 375
Left = 2640
TabIndex = 7
Top = 2400
Width = 1095
End
Begin VB.TextBox Text3
Height = 350
Left = 1680
TabIndex = 6
Top = 1680
Width = 3255
End
Begin VB.TextBox Text2
Height = 350
Left = 1680
TabIndex = 5
Top = 1200
Width = 3255
End
Begin VB.TextBox Text1
Height = 350
Left = 1680
TabIndex = 4
Top = 720
Width = 3255
End
Begin VB.Line Line1
BorderColor = &H00C00000&
BorderStyle = 2 'Dash
DrawMode = 9 'Not Mask Pen
X1 = 120
X2 = 5040
Y1 = 2280
Y2 = 2280
End
Begin VB.Label Label4
Caption = "新密码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 255
Left = 200
TabIndex = 3
Top = 1800
Width = 855
End
Begin VB.Label Label3
Caption = "原密码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 255
Left = 200
TabIndex = 2
Top = 1320
Width = 855
End
Begin VB.Label Label2
Caption = "操作员:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 255
Left = 200
TabIndex = 1
Top = 840
Width = 855
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "请输入操作员名称,原密码和新密码!"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 495
Left = 120
TabIndex = 0
Top = 240
Width = 5175
End
End
Attribute VB_Name = "frmup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Adodc1.RecordSource = "select * from usertb where 名称='" & Text1.Text & "'"
Adodc1.Refresh
If Text1.Text = "" Then
MsgBox "请输入操作员!", , "提示信息"
Text1.SetFocus
Else
On Error Resume Next
If Trim(Text1.Text) <> Adodc1.Recordset.Fields(1) Then
MsgBox "无此操作员,请重新输入!", , "提示信息"
Exit Sub
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
End If
If Text1.Text <> "" And Text2.Text = "" Then
MsgBox "请输入操作员密码!", , "提示信息"
Text2.SetFocus
Exit Sub
Else
If Text2.Text <> Adodc1.Recordset.Fields(2) Then
MsgBox "原密码错误,请重新输入原密码!", , "提示信息"
Text2.Text = ""
Text2.SetFocus
Exit Sub
End If
End If
If Text3.Text <> "" Then
Adodc1.Recordset.Fields(2) = Text3.Text
MsgBox "密码修改成功,退出密码设置!", , "提示信息"
Adodc1.Recordset.Update
Unload Me
Else
MsgBox "请输入新密码!!", , "提示信息"
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Text1.SetFocus
Me.Caption = Me.Caption & " " & frmmain.StatusBar1.Panels(2).Text
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Text2.SetFocus
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Text3.SetFocus
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call Command1_Click
Else
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -