博图如何读取mysql数据_博途使用小结:从SQL中读取数据并给变量赋值

  • Post author:
  • Post category:mysql


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&”‘



版权声明:本文为weixin_39554290原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。