📄 formmm.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form Formmm
BorderStyle = 1 'Fixed Single
Caption = "系统密码"
ClientHeight = 2160
ClientLeft = 45
ClientTop = 435
ClientWidth = 4305
Icon = "Formmm.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2160
ScaleWidth = 4305
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command3
Caption = "删除"
Enabled = 0 'False
Height = 320
Left = 3240
Picture = "Formmm.frx":0CCA
TabIndex = 10
ToolTipText = "删除"
Top = 1200
Width = 855
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 270
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 1
Top = 840
Width = 1575
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
Height = 270
IMEMode = 3 'DISABLE
Left = 1320
MaxLength = 10
PasswordChar = "*"
TabIndex = 2
Top = 1200
Width = 1575
End
Begin VB.TextBox Text3
Appearance = 0 'Flat
Height = 270
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 3
Top = 1560
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "关闭"
Height = 320
Left = 3240
Picture = "Formmm.frx":1054
TabIndex = 5
ToolTipText = "关闭"
Top = 1560
Width = 855
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 320
Left = 3240
Picture = "Formmm.frx":13DE
TabIndex = 4
ToolTipText = "确定"
Top = 840
Width = 855
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 1320
Top = 0
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_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 MSDataListLib.DataCombo DataCombo1
Bindings = "Formmm.frx":1768
DataSource = "Adodc1"
Height = 330
Left = 1320
TabIndex = 0
Top = 360
Width = 1575
_ExtentX = 2778
_ExtentY = 582
_Version = 393216
Appearance = 0
ListField = "姓名"
Text = ""
Object.DataMember = ""
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "服务员"
Height = 180
Left = 360
TabIndex = 9
Top = 480
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "新密码"
Height = 180
Left = 360
TabIndex = 8
Top = 1320
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "确认密码"
Height = 180
Left = 360
TabIndex = 7
Top = 1680
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "旧密码"
Height = 180
Left = 360
TabIndex = 6
Top = 915
Width = 540
End
End
Attribute VB_Name = "Formmm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command1_Click()
On Error GoTo 1
Dim a As String
If Text1.Enabled = False Then
If Text2 = Text3 And Len(Text2) > 0 Then
a = DataCombo1.Text
Adodc1.RecordSource = "SELECT * FROM mm where 姓名='" + DataCombo1 + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields(0) = DataCombo1.Text
Adodc1.Recordset.Fields(1) = Text2.Text
Adodc1.Recordset.Update
retval = Beep(500, 100)
MsgBox "已成功保存。", vbOKCancel, "成功"
Else
MsgBox "该用户名已经存在!", vbCritical, "错误"
End If
End If
Else
Adodc1.RecordSource = "SELECT * FROM mm where 姓名='" + DataCombo1 + "' and 密码='" + Text1 + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 And Text2 = Text3 Then
Adodc1.Recordset.Update "密码", Text2
Adodc1.Refresh
MsgBox "修改成功。", vbOKCancel, "成功"
ElseIf Adodc1.Recordset.RecordCount > 0 And Text2 <> Text3 Then
MsgBox "新密码与密码确认不一致。", vbOKCancel, "错误"
ElseIf Adodc1.Recordset.RecordCount = 0 Then
MsgBox "密码错误", vbOKCancel, "错误"
End If
End If
Text1 = ""
Text2 = ""
Text3 = ""
1
Adodc1.RecordSource = "mm"
Adodc1.Refresh
End Sub
Private Sub Command3_Click()
Adodc1.RecordSource = "SELECT * FROM mm where 姓名='" + DataCombo1 + "'"
Adodc1.Refresh
mm = Adodc1.Recordset("密码")
nval = InputBox("请输入用户密码或管理员密码!", "确认")
If nval = mm Or nval = xtmm Then
Adodc1.Recordset.Delete
Adodc1.Recordset.UpdateBatch
retval = Beep(500, 100)
Adodc1.Refresh
DataCombo1 = ""
Text1 = ""
MsgBox "已成功删除。", vbOKCancel, "成功"
Else
MsgBox "密码错误,删除失败", vbOKCancel, "错误"
End If
Adodc1.RecordSource = "mm"
Adodc1.Refresh
End Sub
Private Sub DataCombo1_Click(Area As Integer)
Label4.Enabled = True
Text1.Enabled = True
Text1.BackColor = &H80000005
If Len(DataCombo1) > 0 Then Command3.Enabled = True
End Sub
Private Sub DataCombo1_KeyUp(KeyCode As Integer, Shift As Integer)
Label4.Enabled = False
Text1.Enabled = False
Text1.BackColor = &H8000000F
Command3.Enabled = False
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = acs
Adodc1.RecordSource = "mm"
Adodc1.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -