发布于 2006-12-19 14:24:11
0楼
这就是要编写的程序
Dim objConnection
Dim strConnectionString
Dim lngValue
Dim strSQL
Dim objCommand
strConnectionString="Provider=MSDASQL;DSN=SampleDSN;UID=;PWD=;"
lngValue=HMIRuntime.Tags("Tag1").Read
strSQL="INSERT INTO WINCC_DATA(TagValue)VALUES("&lngValue&");"
Set objConnection=CreateObject("ADODB.Connection")
objConnection.ConnectionString=ConnectionString
objConnection.open
Set objCommand=CreateObject("ADODB.Connection")
With objCommand
.ActiveConnection=objConnection
.CommandText=strSQL
End With
objCommand.Execute
Set objCommand= Nothing
objConnection.Close
Set objConnection= Nothing
请问这段程序应该写在哪里呢?
急!!!