99久久国产综合精品女不卡-99久久好看一级毛片-99久久精品99999久久-99久久精品费精品国产-99久久精品费精品国产一区二

yuantao0615
級別: 探索解密
精華主題: 0
發帖數量: 73 個
工控威望: 186 點
下載積分: 696 分
在線時間: 45(小時)
注冊時間: 2010-01-04
最后登錄: 2015-12-14
查看yuantao0615的 主題 / 回貼
樓主  發表于: 2013-10-15 17:21
這段代碼在WINCC6.2中可以讀出歸檔數據,在WINCC7.0中為什么卻完全讀不出來歸檔數據呢?
求高手指導啊!!!急急!!!!!!

Dim sPro, sDsn, sSer, sCon, sSql
    Dim conn, oRs, oCom
    Dim DSNName
    Dim i As Integer
    Dim sStart, sStop As String
    
Sub get_wincc_data()

    '--Get Database DSN name-----------------------------------
    Set DSNName = CreateObject("CCHMIRuntime.HMIRuntime")
    sDsn = DSNName.Tags("@DatasourceNameRT").Read
    
    '--build connection string-----------------------------------
    sPro = "Provider=WinCCOLEDBProvider.1;"
    sDsn = "Catalog=" & sDsn & ";"
    sSer = "Data Source=ZHANG\WinCC"
    sCon = sPro & sDsn & sSer
    Set conn = CreateObject("ADODB.Connection")
    conn.ConnectionString = sCon
    conn.CursorLocation = 3
    conn.Open
    Set oRs = CreateObject("ADODB.Recordset")
    Set oCom = CreateObject("ADODB.Command")
    oCom.CommandType = 1
    Set oCom.ActiveConnection = conn
    
  
    sStart = Year(DTPicker1.Value) & "-" & Month(DTPicker1.Value) & "-" & Day(DTPicker1.Value) & " 00:00:00"
    sStop = Year(DTPicker1.Value) & "-" & Month(DTPicker1.Value) & "-" & Day(DTPicker1.Value) & " 23:00:00"
    
  
     sStart = DateAdd("h", -8, CDate(sStart))
     sStop = DateAdd("h", -8, CDate(sStop))
    
  
     sSql = "Tag:R,('ProcessValueArchive\Fan1_T1'),'" & sStart & "','" & sStop & "' order by datetime"
     oCom.CommandText = sSql
    Set oRs = oCom.Execute
    If (oRs.EOF) Then
       oRs.Close
    Else
        oRs.MoveFirst
        i = 0
        Do While Not oRs.EOF
        Sheet1.Cells(i + 4, 2) = oRs.Fields("RealValue").Value
        oRs.MoveNext
        i = i + 1
        Loop
        oRs.Close
    End If
  

    sSql = "Tag:R,('ProcessValueArchive\Fan1_T2'),'" & sStart & "','" & sStop & "' order by datetime"
    oCom.CommandText = sSql
    Set oRs = oCom.Execute
    If (oRs.EOF) Then
       oRs.Close
    Else
        oRs.MoveFirst
        i = 0
        Do While Not oRs.EOF
        Sheet1.Cells(i + 4, 3) = oRs.Fields("RealValue").Value
        oRs.MoveNext
        i = i + 1
        Loop
        oRs.Close
    End If

    sSql = "Tag:R,('ProcessValueArchive\Fan1_P1'),'" & sStart & "','" & sStop & "' order by datetime"
    oCom.CommandText = sSql
    Set oRs = oCom.Execute
    If (oRs.EOF) Then
        oRs.Close
    Else
        oRs.MoveFirst
        i = 0
        Do While Not oRs.EOF
        Sheet1.Cells(i + 4, 4) = oRs.Fields("RealValue").Value
        oRs.MoveNext
        i = i + 1
        Loop
        oRs.Close
    End If
    
  
    sSql = "Tag:R,('ProcessValueArchive\Fan1_P2 '),'" & sStart & "','" & sStop & "' order by datetime"
    oCom.CommandText = sSql
    Set oRs = oCom.Execute
  
    If (oRs.EOF) Then
       oRs.Close
    Else
        oRs.MoveFirst
        i = 0
        Do While Not oRs.EOF
        Sheet1.Cells(i + 4, 5) = oRs.Fields("RealValue").Value
        oRs.MoveNext
        i = i + 1
        Loop
        oRs.Close
    End If
    
Set oRs = Nothing
Set conn = Nothing
End Sub


Private Sub DTPicker1_Change()
clear_cell get_wincc_data
End Sub

Sub clear_cell()
For i = 4 To 27
  For j = 2 To 5
  Cells(i, j) = ""
  Next j
Next i
End Sub
yuantao0615
級別: 探索解密
精華主題: 0
發帖數量: 73 個
工控威望: 186 點
下載積分: 696 分
在線時間: 45(小時)
注冊時間: 2010-01-04
最后登錄: 2015-12-14
查看yuantao0615的 主題 / 回貼
1樓  發表于: 2013-10-15 23:08
是不是因為ConnectivityPack沒有授權的緣故呢?

主站蜘蛛池模板: 欧美二区在线观看| 日韩黄色在线| 欧洲欧美人成免费观看| 害羞的清纯女神露脸在线视频| 国产在线观看的| 日韩 第一页| 在线影片| 一级毛片在线直接观看| 日韩高清在线免费看| 在线 你懂的| 免费的全黄一级录像带| 国产a级特黄的片子视频免费| 看免费黄色| 黄色影视在线| 99热国产这里只有精品99| 精品国产人成在线| 欧美国产一区二区| 天天综合色网| 亚洲欧美日产综合一区二区三区| www黄色免费| 大陆一级毛片免费高清| 日韩一区二三区无| 毛片三| 亚洲精彩视频| 成人美女免费网站视频| 两性毛片| 免费一级黄色片| 久久综合狠狠综合久久| 天天久久| 桐岛永久子| 亚洲国产成人久久综合一区| 亚洲线精品一区二区三区| 91视频一88av| 91精品免费观看| a一级一色一情| aaa国产一级毛片| 91精品天美精东蜜桃传媒免费| 一级视频网站| yjizz视频国产网站在线播放| 久久久久综合| 一级黄黄色片|