📄 main_mima.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 main_mima
BackColor = &H00808080&
BorderStyle = 3 'Fixed Dialog
Caption = "商品销售管理系统 版本v1.00"
ClientHeight = 2490
ClientLeft = 45
ClientTop = 330
ClientWidth = 5490
Icon = "main_mima.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "main_mima.frx":000C
ScaleHeight = 2490
ScaleWidth = 5490
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin MSDataListLib.DataCombo DataCombo1
Bindings = "main_mima.frx":3E88A
Height = 330
Left = 1875
TabIndex = 7
Top = 420
Width = 2790
_ExtentX = 4921
_ExtentY = 582
_Version = 393216
MatchEntry = -1 'True
Style = 2
ListField = "操作员名称"
Text = ""
End
Begin VB.Frame Frame1
Caption = "Frame1"
Height = 930
Left = -1410
TabIndex = 5
Top = 1395
Visible = 0 'False
Width = 1680
Begin VB.TextBox Textime
Height = 270
Left = 45
TabIndex = 6
Top = 390
Visible = 0 'False
Width = 1230
End
Begin MSAdodcLib.Adodc Adodc1
Height = 360
Left = 90
Top = 255
Visible = 0 'False
Width = 1425
_ExtentX = 2514
_ExtentY = 635
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 = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=XSGL"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=XSGL"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 操作员信息表"
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
End
Begin VB.CommandButton Cmd2
BackColor = &H00C0C0C0&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 3765
Picture = "main_mima.frx":3E89F
Style = 1 'Graphical
TabIndex = 2
Top = 1815
Width = 1350
End
Begin VB.CommandButton Cmd1
BackColor = &H00C0C0C0&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 2430
MaskColor = &H00FF8080&
Picture = "main_mima.frx":40259
Style = 1 'Graphical
TabIndex = 0
Top = 1815
UseMaskColor = -1 'True
Width = 1350
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 1875
PasswordChar = "*"
TabIndex = 1
Top = 945
Width = 2790
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "版权所有 违者必究"
Height = 465
Left = 360
TabIndex = 8
Top = 1980
Width = 1830
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "密 码: "
BeginProperty Font
Name = "黑体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 990
TabIndex = 4
Top = 975
Width = 855
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "操作员: "
BeginProperty Font
Name = "黑体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 990
TabIndex = 3
Top = 480
Width = 1095
End
End
Attribute VB_Name = "main_mima"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Tim As Integer '定义一个整型变量
Dim rs1 As New ADODB.Recordset '定义一个数据集对象
Dim myval As String '定义一个单精度浮点型变量
Private Sub DataCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text2.SetFocus 'text2获得焦点
End Sub
Private Sub Form_Activate()
DataCombo1.SetFocus
End Sub
Private Sub text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
Cmd1.Visible = True
Cmd1.SetFocus
End If
End Sub
Private Sub Cmd1_Click()
rs1.Open "select * from 操作员信息表 where 操作员名称='" & DataCombo1.BoundText & "'", Cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If DataCombo1.Text = "" Then
MsgBox ("请选择操作员!"), vbOKOnly
DataCombo1.SetFocus
Exit Sub
End If
'验证操作员及密码
Dim MESSAGE As String
Textime.Text = Tim
If Text2.Text = rs1.Fields("密码") Then
Load frm_main
frm_main.Show
czy = DataCombo1.Text
Unload Me
Else
If Tim = 3 Then
MESSAGE = MsgBox("密码输入错误,请向系统管理员查询!", 0, "")
If MESSAGE = vbOK Then End
End If
If Text2.Text <> rs1.Fields("密码") Then
MsgBox ("密码错误,请重新输入密码!")
Tim = Tim + 1
Text2.SetFocus
End If
End If
Else
MsgBox "初次登录本系统,请在进入系统后,立即设置操作员及其密码,以确保系统的安全!", , "提示窗口"
Load frm_main
frm_main.Show
Unload Me
End If
rs1.Close
End Sub
Private Sub cmd2_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -