|
’班次查詢子函數,獲取查詢字符串
Public Function sch_team()
Dim liner_str
Dim sch_str_team
Select Case Combo_team.ListIndex
Case 0
liner_str = "甲班"
Case 1
liner_str = "乙班"
Case 2
liner_str = "丙班"
Case 3
liner_str = "丁班"
End Select
sch_str_team = "info_liner = ’" + liner_str + "’"
sch_team = sch_str_team
End Function
’產量查詢函數,用於查詢產量並對其進行顯示
Private Sub cmd_search_Click()
Dim sch_str
’按班次查詢
If Chk_team.Value = 1 Then
sch_str = " where " + sch_team()
End If
’查詢結果顯示
Dim resource_str
resource_str = " select info_id as 編號,info_mactype as 機器類型 ,info_liner as 班次, "
resource_str = resource_str + " info_sumoutput as 當日產量, info_dayoutput as 累計產量,"
resource_str = resource_str + " info_daytotal as 當日合計產量,info_total as 累計合計產量 "
resource_str = resource_str + " from " + table_str + sch_str
Adodc1.RecordSource = resource_str
Debug.Print Adodc1.RecordSource
Adodc1.Refresh
End Sub
可根據以上單獨查詢班次的例子對其進行擴展,增加根據時間,車號,產量範圍等對產量進行查詢的功能,這裏就不一一敘述了。
四、結束語
觸摸屏與上位機的結合,並通過VB6.0傳(chuan)送(song)數(shu)據(ju)所(suo)構(gou)成(cheng)的(de)計(ji)算(suan)機(ji)監(jian)控(kong)係(xi)統(tong),對(dui)於(yu)近(jin)距(ju)離(li)傳(chuan)輸(shu)數(shu)據(ju)的(de)現(xian)場(chang)控(kong)製(zhi)來(lai)說(shuo)是(shi)一(yi)種(zhong)性(xing)價(jia)比(bi)很(hen)高(gao)的(de)解(jie)決(jue)方(fang)案(an)。該(gai)係(xi)統(tong)充(chong)分(fen)的(de)利(li)用(yong)了(le)觸(chu)摸(mo)屏(ping)的(de)通(tong)信(xin)功(gong)能(neng)和(he)PC強大的圖形顯示、浮點運算等特點,以最大的限度合理的利用了資源,實現了對設備運行狀態的監控。
|