1、建立内部变量TON_Report,VF01_Runtime,JC01_Runtime,VF05_Runtime,数据类型为Real,长度为2
2、建立查询按钮,点击查询按钮时读取SQL中的数据并赋值给TON_Report;查询按钮VBS脚本及注释如下:
Dim conn
Dim SCon
Dim oRs
Dim oCom
Dim oRs1
Dim strSQL
Dim m
SCon= “Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist
Security Info=False;Initial Catalog=WINCC;Data
Source=.\WINCC”‘数据库连接字符串
Set conn=CreateObject(“ADODB.Connection”)
conn.ConnectionString =
SCon
conn.CursorLocation = 3
conn.Open ‘建立连接
‘TON_Report =”Select TON FROM [day] where
Year(TTime)='”&My_Year&”‘ and
Month(TTime)='”&My_Month&”‘ and
Day(TTime)='”&My_Day&”‘