wincc归档压缩数据怎样读取做报表用
最佳答案
DimoRs
Dimconn
DimoCom
sCon="Provider=SQLOLEDB.1;"&_
"IntegratedSecurity=SSPI;"&_
"PersiSTSecurityInfO=False;"&_
"InitialCataloG=CC_foRTESt_10_08_22_10_02_39R;"&_
"DatASourCE=.\WinCC"
Setconn=CreateObject("ADODB.Connection")
conn.ConnectionString=sCon
conn.CursorLocation=3
conn.Open
SetoRs=CreateObject("ADODB.Recordset")
SetoCom=CreateObject("ADODB.Command")
oCom.CommandType=1
SetoCom.ActiveConnection=conn
sSql_1="Tag:R,”Archive1\tag1”,”2012-9-2910:00:00”,”2012-9-2912:00:00”"
oCom.CommandText=sSql_1
SetoRs=oCom.Execute
oRs.MoveFirst
msgboxoRs.Fields(2).Value
以上脚本是读取归档Archive1中,变量tag1从10点到12点的数据,然后弹出读取到的第一个数据值,因为从10点到12点会读取到很多数据,将以上脚本做修改,你可以查询任何时刻的归档数据。
提问者对于答案的评价:
谢谢