CREATE PROCedure[owner.]procedurename[number]
[[(]@parameter_name datatype[=default][OUTput]
[,@parameter_name datatype[=default][OUTput]]...[)]]
[WITH RECOMPILE]
AS SQL_statements
2、存储规则:
[EXECute][@return-status=]
[[[server.]database.]owner.]procedurename[number]
[[@parameter_name=]value|[@parameter_name=]@varialbe[OUTput]
[,[@parameter_name=]value|[@parameter_name=]@variable[OUTput]...]]
[WITH RECOMPILE]
WinCC的VBS虽可以声明Public变量,但作用域仅限于本画面,如下:
如果WinCC版本>=V6.0 SP3,则可以使用Dataset对象,该对象可以在不同的VBS脚本中进行访问,下面是个简单的例子:
1、连接
Dim objConnection,strConnectionString
strConnectionString ="Driver={SQL Server}Server=.\WINCCuid=pass=database=guowincc"
Set objConnection = CreateObject("ADODB.Connection")
objConnection.ConnectionString = strConnectionString
objConnection.open
HMIRuntime.DataSet.Add "objConnection",objConnection
2、全局动作中引用
Dim objConnection
objConnection= HMIRuntime.DataSet("objConnection").Value
with objCommand
.ActiveConnection = objConnection
xxxxxxxx
3、关闭连接:
Dim objConnection
objConnection= HMIRuntime.DataSet("objConnection").Value
objConnection.Close
Set objConnection = Nothing
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)