请问你知道wincc 怎样通过vbs脚本与mysql数据库建立链接吗? 10
1个回答
2017-08-30
展开全部
如何wincc中使用VBS脚本读写SQLServer数据库文件
set cn = CreateObject("ADODB.Connection")
set rs = CreateObject("ADODB.Recordset")
cn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;data source=192.168.0.102;User ID=sa;Password=password;Initial Catalog=DBName"
rs.Open "select * from Qsoft", cn, 1,3
While Not (rs.EOF)
msgbox rs("ID")
rs.MoveNext
Wend
rs.Close
cn.Close
set cn = CreateObject("ADODB.Connection")
set rs = CreateObject("ADODB.Recordset")
cn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;data source=192.168.0.102;User ID=sa;Password=password;Initial Catalog=DBName"
rs.Open "select * from Qsoft", cn, 1,3
While Not (rs.EOF)
msgbox rs("ID")
rs.MoveNext
Wend
rs.Close
cn.Close
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询