8/25/2017 4:47 PM | |
Posts: 1 Rating: (0) |
Dear experts! I used to work with Wincc7.2 and Windows XP. To access the data, I used the example "Export of WinCC / CAS Archive Data using the WinCC OLE DB Provider:”https://support.industry.siemens.com/cs/ww/en/view/35840700 Everything was working fine. I recently started to use Wincc7.4 and Windows 7 and this script is not working. Option “WinCC Connectivity Pack client ” installed. Dim sPro As String Dim sDsn As String Dim sSer As String Dim sCon As String Dim sSql As String Dim conn As Object Dim oRs As Object Dim oCom As Object Dim oItem As ListItem Dim m, n, s sPro = "Provider=WinCCOLEDBProvider.1;" sDsn = "Catalog=CC_OpConPac_04_10_01_10_36_36R;" sSer = "Data Source=.\WinCC sCon = sPro + sDsn + sSer sSql = "TAG:R,'ArTags\Tag_1','0000-00-00 00:10:00.000','0000-00-00 00:00:00.000'" 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 oCom.CommandText = sSql Set oRs = oCom.Execute m = oRs.Fields.Count If (m > 0) Then oRs.MoveFirst n = 0 Do While Not oRs.EOF n = n + 1 If (n < 100) Then s = Left(CStr(oRs.Fields(1).Value), 23) End If oRs.MoveNext Loop oRs.Close Else End If Set oRs = Nothing conn.Close Set conn = Nothing ---------------------------------------------------------- Set oRs = oCom.Execute - this line is not executed, the script does not work thank! |
Last edited by: Mike_Waz at: 8/25/2017 4:48:38 PMLast edited by: Mike_Waz at: 8/28/2017 6:15:16 PMLast edited by: Mike_Waz at: 8/28/2017 6:46:28 PM |
|
Follow us on