本地上位机为WINCC,局域网内有上位机软件杰控,想要读取杰控中SQL的数据,在WINCC生成报表,怎样才能实现?
钻石用户推荐最佳答案
dim conn
set conn=WScript.CreateObject("ADODB.Connection")
conn.Open "Driver={SQL server};server=192.168.1.1;database=mydb;uid=myuser;pwd=mypwd;"
dim rst
set rst=WScript.CreateObject("ADODB.Recordset")
sSQL="select * from ......"
rst.open sSQL,conn,1,1
if rst.eof and rst.bof then
WScript.Echo "没有记录"
else
do while not rst.eof
WScript.Echo rst("Field1") & " " & rst("Field2")
rs.movenext
loop
end if
WScript.QUIT
rst.close
set rst=nothing
conn.close
set conn=thing
提问者对于答案的评价:
原创文章,作者:ximenziask,如若转载,请注明出处:https://www.zhaoplc.com/plc354722.html