📄 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 = 1 'Fixed Single
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
StartUpPosition = 1 '所有者中心
Begin MSDataListLib.DataCombo DataCombo1
Bindings = "main_mima.frx":3E88A
Height = 330
Left = 3195
TabIndex = 7
Top = 435
Width = 1920
_ExtentX = 3387
_ExtentY = 582
_Version = 393216
MatchEntry = -1 'True
Style = 2
ListField = "操作员名称"
Text = ""
End
Begin VB.Frame Frame1
Caption = "Frame1"
Height = 930
Left = -1425
TabIndex = 5
Top = 2025
Visible = 0 'False
Width = 1680
Begin VB.TextBox Textime
Height = 270
Left = 165
TabIndex = 6
Top = 555
Visible = 0 'False
Width = 1230
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 90
Top = 210
Width = 1500
_ExtentX = 2646
_ExtentY = 582
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=Gcgl;Initial Catalog=Gcgl"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=Gcgl;Initial Catalog=Gcgl"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from qxsz"
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 = 315
IMEMode = 3 'DISABLE
Left = 3195
MaxLength = 6
PasswordChar = "*"
TabIndex = 1
Top = 960
Width = 1920
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "版权所有 违者必究"
Height = 465
Left = 360
TabIndex = 8
Top = 1980
Width = 1830
End
Begin VB.Image Image1
Height = 1440
Left = 330
Picture = "main_mima.frx":41B9C
Stretch = -1 'True
Top = 210
Width = 1650
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 = 2310
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 = 2310
TabIndex = 3
Top = 495
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 Form_Activate()
'显示软件名称及版本信息
Me.Caption = App.Title & " 版本: V" & App.Major & "." & App.Minor & "." & App.Revision
rs1.Open "select * from qxsz ", cnn, adOpenKeyset, adLockOptimistic '打开数据库
If rs1.RecordCount = 0 Then
'当记录为零时,进入系统具有所有权限
myval = MsgBox("进入系统后先设置操作员和操作员权限!", 0, "")
Load frm_main
frm_main.Show
Unload Me
Else
DataCombo1.SetFocus 'DataCombo1获得焦点
End If
rs1.Close
End Sub
Private Sub DataCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text2.SetFocus 'text2获得焦点
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 qxsz where 操作员名称='" & DataCombo1.BoundText & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
frm_main.rkd.Enabled = rs1.Fields("入库单")
frm_main.Toolbar1.Buttons(1).Enabled = rs1.Fields("入库单")
frm_main.kccx.Enabled = rs1.Fields("库存查询")
frm_main.Toolbar1.Buttons(3).Enabled = rs1.Fields("库存查询")
frm_main.kcpd.Enabled = rs1.Fields("库存盘点")
frm_main.xscx.Enabled = rs1.Fields("销售查询")
frm_main.Toolbar1.Buttons(6).Enabled = rs1.Fields("销售查询")
frm_main.rkcx.Enabled = rs1.Fields("入库查询")
frm_main.Toolbar1.Buttons(8).Enabled = rs1.Fields("入库查询")
frm_main.fkd.Enabled = rs1.Fields("付款单")
frm_main.Toolbar1.Buttons(11).Enabled = rs1.Fields("付款单")
frm_main.skcx.Enabled = rs1.Fields("应收款查询")
frm_main.fkcx.Enabled = rs1.Fields("应付款查询")
frm_main.xsrbb.Enabled = rs1.Fields("销售日报表")
frm_main.xsybb.Enabled = rs1.Fields("销售月报表")
frm_main.khxsbb.Enabled = rs1.Fields("客户销售报表")
frm_main.zyxsbb.Enabled = rs1.Fields("职员销售报表")
frm_main.spinf.Enabled = rs1.Fields("商品信息管理")
frm_main.yginf.Enabled = rs1.Fields("员工信息管理")
frm_main.ckinf.Enabled = rs1.Fields("仓库信息管理")
frm_main.gysinf.Enabled = rs1.Fields("供应商信息管理")
frm_main.Toolbar1.Buttons(14).Enabled = rs1.Fields("供应商信息管理")
frm_main.khinf.Enabled = rs1.Fields("客户信息管理")
frm_main.Toolbar1.Buttons(16).Enabled = rs1.Fields("客户信息管理")
frm_main.bdwdy.Enabled = rs1.Fields("本单位定义")
frm_main.czysz.Enabled = rs1.Fields("操作员及密码管理")
frm_main.qxsz.Enabled = True
frm_main.xtcsh.Enabled = rs1.Fields("系统初始化")
'验证操作员及密码
Dim MESSAGE As String
Textime.Text = TIM
Adodc1.RecordSource = "select * from qxsz where 操作员名称='" + DataCombo1.BoundText + "'"
Adodc1.Refresh
If DataCombo1.BoundText <> "" And Text2.Text = Trim(Adodc1.Recordset.Fields("密码")) Then
Load frm_main
frm_main.Show
frm_main.St1.Panels(3).Text = Trim(DataCombo1.Text)
Unload Me
Else
If TIM = 3 Then
MESSAGE = MsgBox("密码输入错误,请向系统管理员查询!", 0, "")
If MESSAGE = vbOK Then End
End If
If DataCombo1.BoundText = "" Then
MsgBox ("请输入操作员!")
DataCombo1.SetFocus
Else
If Trim(DataCombo1.BoundText) <> Trim(Adodc1.Recordset.Fields("操作员名称")) Then
MsgBox ("查无此操作员,请重新输入操作员!")
DataCombo1.SetFocus
Else
If Text2.Text <> Adodc1.Recordset.Fields("密码") Then
MsgBox ("密码错误,请重新输入密码!")
TIM = TIM + 1
Text2.SetFocus
End If
End If
End If
End If
End If
rs1.Close
End Sub
Private Sub cmd2_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -