?? frmmain.frm
字號:
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":3F42
Key = "open"
EndProperty
EndProperty
End
End
Begin MSComctlLib.ImageList imlToolbarIcons
Left = 1710
Top = 6300
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 14
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":403C
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":4CBE
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":5910
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":6562
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":71B4
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":7F4E
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":8CA0
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":98F2
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":A644
Key = ""
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":B396
Key = ""
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":C0E8
Key = ""
EndProperty
BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":CD3A
Key = ""
EndProperty
BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":D98C
Key = ""
EndProperty
BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":E5DE
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.TreeView tvTreeView
Height = 4320
Left = 0
TabIndex = 6
Top = 1890
Width = 2970
_ExtentX = 5239
_ExtentY = 7620
_Version = 393217
HideSelection = 0 'False
Style = 7
HotTracking = -1 'True
ImageList = "ImageList1"
Appearance = 1
End
Begin MSComctlLib.ImageList ImageList1
Left = 1305
Top = 5580
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 3
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":F230
Key = "closed"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":F32A
Key = "leaf"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":F424
Key = "open"
EndProperty
EndProperty
End
Begin MSComctlLib.TabStrip TabStrip1
Height = 6315
Left = 3465
TabIndex = 19
Top = 1035
Width = 9105
_ExtentX = 16060
_ExtentY = 11139
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 2
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "實時監控"
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "歷史數據分析"
ImageVarType = 2
EndProperty
EndProperty
End
Begin MSComctlLib.TreeView TreeView1
Height = 4320
Left = 0
TabIndex = 20
Top = 1980
Width = 2970
_ExtentX = 5239
_ExtentY = 7620
_Version = 393217
HideSelection = 0 'False
Style = 7
HotTracking = -1 'True
ImageList = "ImageList1"
Appearance = 1
End
Begin MSComctlLib.TabStrip TabStrip2
Height = 4245
Left = -180
TabIndex = 21
Top = 1980
Width = 2985
_ExtentX = 5265
_ExtentY = 7488
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 2
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "按行業"
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "按地區"
ImageVarType = 2
EndProperty
EndProperty
End
Begin VB.Label Label8
Caption = "Label7"
Height = 285
Left = 0
TabIndex = 7
Top = 0
Width = 1860
End
Begin VB.Line Line3
BorderColor = &H8000000A&
BorderWidth = 3
X1 = 0
X2 = 8160
Y1 = 0
Y2 = 0
End
Begin VB.Image imgSplitter
Height = 4785
Left = 3015
MousePointer = 9 'Size W E
Top = 1485
Width = 150
End
Begin VB.Menu mnuFile
Caption = "文件(&F)"
Begin VB.Menu mnuFilePrint
Caption = "打印(&P)..."
End
Begin VB.Menu mnuFileBar5
Caption = "-"
End
Begin VB.Menu mnuFileClose
Caption = "關閉(&C)"
End
End
Begin VB.Menu mnuEdit
Caption = "編輯(&E)"
Begin VB.Menu mnufind
Caption = "查找(&F)"
End
Begin VB.Menu mnudo
Caption = "操作(&D)"
End
End
Begin VB.Menu mnutool
Caption = "系統維護(&S)"
Begin VB.Menu mnuset
Caption = "設置"
End
Begin VB.Menu mnupwd
Caption = "用戶密碼(&W)"
End
End
Begin VB.Menu mnuView
Caption = "視圖(&V)"
Begin VB.Menu mnuViewToolbar
Caption = "工具欄(&T)"
Checked = -1 'True
End
Begin VB.Menu mnuViewStatusBar
Caption = "狀態欄(&B)"
Checked = -1 'True
End
End
Begin VB.Menu mnuHelp
Caption = "幫助(&H)"
Begin VB.Menu mnuHelpAbout
Caption = "關于(&A) "
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mbMoving As Boolean
Const sglSplitLimit = 500
Private Sub Command2_Click()
'月流量查詢
Dim intnum As Single
Dim introw As Single, intcol As Single
Dim adomonthrs As Recordset, adoyearrs As Recordset
Dim db As Connection
Dim sql As String
On Error GoTo errordo
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" & App.Path & "\db1.mdb;"
Set adomonthrs = New Recordset
sql = "select * from 月排放量記錄 where 企業名稱 ='" & adoPrimaryRS!企業名稱 _
& "' and 記錄時間='" & Combo2.Text & "/" & LTrim(Combo3.Text) & "'"
adomonthrs.Open sql, db, adOpenStatic, adLockOptimistic
If adomonthrs.EOF Then
MsgBox "沒有記錄!"
Else
'顯示記錄
For introw = 1 To 5 Step 2
For intcol = 0 To 10
If introw < 5 Or intcol <= 8 Then
MSFlexGrid1.Row = introw
MSFlexGrid1.Col = intcol
MSFlexGrid1.CellForeColor = &HC25B10
MSFlexGrid1.Text = Str(adomonthrs.Fields.Item(intcol + 3 + intnum * 11))
MSChart3.Row = intcol + 1 + intnum * 11
MSChart3.Data = Val(MSFlexGrid1.Text)
End If
Next intcol
intnum = intnum + 1
Next introw
Exit Sub
End If
Exit Sub
errordo:
MsgBox Err.Description
End Sub
Private Sub Command3_Click()
Picture1(2).ZOrder
End Sub
Private Sub Command4_Click()
Picture1(1).ZOrder
End Sub
Private Sub Command5_Click()
Picture1(1).ZOrder
End Sub
Private Sub Command6_Click()
Picture1(2).ZOrder
End Sub
Private Sub Command7_Click()
'年排放量查詢
Dim intnum As Single
Dim introw As Single, intcol As Single
Dim adoyearrs As Recordset
Dim db As Connection
Dim sql As String
On Error GoTo errordo
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" & App.Path & "\db1.mdb;"
Set adoyearrs = New Recordset
sql = "select * from 年排放量記錄 where 企業名稱 ='" & adoPrimaryRS!企業名稱 _
& "' and 記錄時間='" & Combo1.Text & "'"
adoyearrs.Open sql, db, adOpenStatic, adLockOptimistic
If adoyearrs.EOF Then
MsgBox "沒有記錄!"
Else
'顯示記錄
MSChart2.Column = 1
For introw = 1 To 3 Step 2
For intcol = 0 To 5
MSFlexGrid2.Row = introw
MSFlexGrid2.Col = intcol
MSFlexGrid2.CellForeColor = &HC25B10
MSFlexGrid2.Text = Str(adoyearrs.Fields.Item(intcol + 3 + intnum * 6))
MSChart2.Row = intcol + 1 + intnum * 6
MSChart2.Data = Val(MSFlexGrid2.Text) / 10
Next intcol
intnum = intnum + 1
Next introw
End If
Exit Sub
errordo:
MsgBox Err.Description
End Sub
Private Sub Form_Load()
Dim intcol As Single, introw As Single
Dim intyear As Integer, intmonth As Single
Dim xnode As Node
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" & App.Path & "\db1.mdb;"
'在tvTreeView控件中按企業類別不同顯示數據庫中的記錄
Set xnode = tvTreeView.Nodes.Add(, , "企業部門", "企業部門", 3)
xnode.Expanded = True
Set xnode = tvTreeView.Nodes.Add("企業部門", tvwChild, "醫藥", "醫藥", 1)
Set xnode = tvTreeView.Nodes.Add("企業部門", tvwChild, "農林牧漁", "農林牧漁", 1)
Set xnode = tvTreeView.Nodes.Add("企業部門", tvwChild, "工業", "工業", 1)
Set xnode = tvTreeView.Nodes.Add("企業部門", tvwChild, "建筑業", "建筑業", 1)
Set xnode = tvTreeView.Nodes.Add("企業部門", tvwChild, "飲食業", "飲食業", 1)
Set xnode = tvTreeView.Nodes.Add("企業部門", tvwChild, "教育事業", "教育事業", 1)
Set xnode = tvTreeView.Nodes.Add("企業部門", tvwChild, "其他行業", "其他行業", 1)
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "select * from 排污企業 ", db, adOpenStatic, adLockOptimistic
adoPrimaryRS.MoveFirst
Do Until adoPrimaryRS.EOF
Select Case adoPrimaryRS!企業類別
Case "醫藥"
Set xnode = tvTreeView.Nodes.Add("醫藥", tvwChild, , adoPrimaryRS!企業名稱, 2)
xnode.Tag = adoPrimaryRS!編號ID
Case "農林牧漁"
Set xnode = tvTreeView.Nodes.Add("農林牧漁", tvwChild, , adoPrimaryRS!企業名稱, 2)
xnode.Tag = adoPrimaryRS!編號ID
Case "工業"
Set xnode = tvTreeView.Nodes.Add("工業", tvwChild, , adoPrimaryRS!企業名稱, 2)
xnode.Tag = adoPrimaryRS!編號ID
Case "建筑業"
Set xnode = tvTreeView.Nodes.Add("建筑業", tvwChild, , adoPrimaryRS!企業名稱, 2)
xnode.Tag = adoPrimaryRS!編號ID
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -