?? main_mm.frm
字號:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form main_mm
BackColor = &H00C0C0C0&
Caption = "圖書綜合管理系統(tǒng)"
ClientHeight = 3660
ClientLeft = 60
ClientTop = 345
ClientWidth = 6150
Icon = "main_mm.frx":0000
LinkTopic = "Form1"
ScaleHeight = 3660
ScaleWidth = 6150
StartUpPosition = 1 '所有者中心
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = -45
Top = 1830
Visible = 0 'False
Width = 1995
_ExtentX = 3519
_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= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=NBooks"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "NBooks"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from qxb"
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 MSComctlLib.ImageList ImageList1
Left = 15
Top = 1035
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 10
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_mm.frx":000C
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_mm.frx":0EE8
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_mm.frx":17C4
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_mm.frx":20A0
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_mm.frx":23BC
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_mm.frx":2C98
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_mm.frx":3574
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_mm.frx":3E50
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_mm.frx":472C
Key = ""
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_mm.frx":5008
Key = ""
EndProperty
EndProperty
End
Begin VB.TextBox Txttime
Height = 270
Left = -60
TabIndex = 10
Top = 2205
Visible = 0 'False
Width = 900
End
Begin MSComctlLib.ListView ListView1
Height = 2265
Left = 135
TabIndex = 7
Top = 465
Width = 5835
_ExtentX = 10292
_ExtentY = 3995
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 393217
Icons = "ImageList1"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
Begin VB.Frame Frame1
Height = 45
Left = 150
TabIndex = 6
Top = 375
Width = 5880
End
Begin VB.CommandButton CmdEnd
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 = 4635
Picture = "main_mm.frx":532C
Style = 1 'Graphical
TabIndex = 2
Top = 3150
Width = 1350
End
Begin VB.CommandButton CmdOk
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 = 3285
MaskColor = &H00FF8080&
Picture = "main_mm.frx":6CE6
Style = 1 'Graphical
TabIndex = 0
Top = 3150
UseMaskColor = -1 'True
Width = 1350
End
Begin VB.TextBox Text1
BackColor = &H00FFFF00&
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 = 915
MaxLength = 6
PasswordChar = "*"
TabIndex = 1
Top = 3210
Width = 1965
End
Begin VB.Label jb
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 195
Left = 4530
TabIndex = 11
Top = 2835
Width = 1560
End
Begin VB.Label bh
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 195
Left = 2550
TabIndex = 9
Top = 2835
Width = 795
End
Begin VB.Label czy
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 195
Left = 930
TabIndex = 8
Top = 2835
Width = 960
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "在下面選擇用來登錄的身份:"
Height = 225
Left = 180
TabIndex = 5
Top = 90
Width = 2955
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "密 碼: "
Height = 300
Left = 195
TabIndex = 4
Top = 3270
Width = 855
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "操作員: 編號: 操作員級別: "
Height = 195
Left = 210
TabIndex = 3
Top = 2835
Width = 4500
End
End
Attribute VB_Name = "main_mm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim itmX As ListItem '聲明一個ListItem對象
Dim MyIcon As Integer '聲明一個整型變量
Dim text, MyMsg As String '聲明字符串變量
Private Sub Form_Activate()
Text1.SetFocus 'text1獲得焦點
End Sub
Private Sub Form_Load()
'添加操作員
Adodc1.RecordSource = "select * from qxb"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
With Adodc1.Recordset
.MoveFirst
czy.Caption = .Fields("操作員")
bh.Caption = .Fields("編號")
jb.Caption = .Fields("操作員級別")
Do While .EOF = False
text = .Fields("操作員")
MyIcon = Val(Right(.Fields("頭像"), Val(Len(.Fields("頭像")) - 2)))
Set itmX = ListView1.ListItems.Add(, , text, MyIcon)
.MoveNext
Loop
End With
End If
End Sub
Private Sub ListView1_Click()
If ListView1.ListItems.Count > 0 Then
'查詢操作員信息
Adodc1.RecordSource = "select * from qxb where 操作員='" + ListView1.SelectedItem + "'"
Adodc1.Refresh
With Adodc1.Recordset
If .RecordCount > 0 Then
'賦值給czy.caption等
czy.Caption = .Fields("操作員")
bh.Caption = .Fields("編號")
If .Fields("操作員級別") <> "" Then jb.Caption = .Fields("操作員級別")
End If
End With
End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
'回車使CmdOk按鈕獲得焦點
If KeyCode = vbKeyReturn Then CmdOk.SetFocus
End Sub
Private Sub cmdOK_Click()
Adodc1.RecordSource = "select * from qxb where 操作員 = '" + Trim(czy.Caption) + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
With Adodc1.Recordset
frm_main.jcxxgl.Enabled = .Fields("基礎(chǔ)信息管理")
frm_main.Toolbar1.Buttons(1).Enabled = .Fields("基礎(chǔ)信息管理")
frm_main.tsgl.Enabled = .Fields("圖書管理")
frm_main.Toolbar1.Buttons(5).Enabled = .Fields("圖書管理")
frm_main.Toolbar1.Buttons(11).Enabled = .Fields("圖書管理")
frm_main.jygl.Enabled = .Fields("借閱管理")
frm_main.Toolbar1.Buttons(7).Enabled = .Fields("借閱管理")
frm_main.Toolbar1.Buttons(9).Enabled = .Fields("借閱管理")
frm_main.jcfx.Enabled = .Fields("決策分析")
frm_main.xtwh.Enabled = .Fields("系統(tǒng)維護(hù)")
frm_main.xtgl.Enabled = .Fields("系統(tǒng)管理")
frm_main.Toolbar1.Buttons(13).Enabled = .Fields("系統(tǒng)管理")
End With
'驗證操作員及密碼
If Text1.text = Adodc1.Recordset.Fields("密碼") Then
Load frm_main
frm_main.Show
frm_main.St1.Panels(3).text = czy.Caption
Unload Me
Else
If czy.Caption = "" Then
MsgBox ("請選擇操作員!")
ListView1.SetFocus
Else
If Text1.text <> Adodc1.Recordset.Fields("密碼") Then
MsgBox ("密碼錯誤,請重新輸入密碼!")
Txttime.text = Val(Txttime.text) + 1
Text1.SetFocus
End If
End If
If Txttime.text = "3" Then '密碼錯誤3次,退出系統(tǒng)
MyMsg = MsgBox("密碼輸入錯誤,請向系統(tǒng)管理員查詢!", , "")
If MyMsg = vbOK Then End
End If
End If
End If
End Sub
Private Sub CmdEnd_Click()
End
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -