win7 64位系统,wincc7.3,Access 2013,结果是啥反应都没有!什么情况?
Option Explicit
Function action
Dim objConnection
Dim strConnectionString
Dim WB
Dim RQ
Dim strSQL
Dim objCommand
Dim riqi
riqi = NoW
strConnectionString = "Provider=MSDASQL;DSN=WINCC_JILU;UID=;PWD=;"
WB = HMIRuntime.Tags ("Record").Read
RQ = riqi
strSQL = "INSERT INTO WINCC_JL (日期,提示文本) VALUES ("& RQ &","& WB &");"
Set objConnection = CreateObject("ADODB.Connection")
objConnection.ConnectionString = strConnectionString
objConnection.Open
Set objCommand = CreateObject("ADODB.Command")
With objCommand
.ActiveConnection = objConnection
.CommandText = strSQL
End With
objCommand.Execute
Set objCommand = Nothing
objConnection.Close
Set objConnection = Nothing
End Function