?? 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 + -