发布于 2009-12-31 10:16:52
6楼
同意万斑的意见,给段我写的部分代码(时间部分)
'create a sql command string
strText(0)=HMIRuntime.Tags("iYear1").Read
strText(1)=HMIRuntime.Tags("iMonth1").Read
strText(2)=HMIRuntime.Tags("iDay1").Read
strText(3)=HMIRuntime.Tags("iHour1").Read
strText(4)=HMIRuntime.Tags("iMinute1").Read
strText(5)=HMIRuntime.Tags("iSecond1").Read
strSql="'" & strText(0) & "-" & strText(1) & "-" & strText(2) & " "
strSql=strSql & strText(3) & ":" & strText(4) & ":" & strText(5) & "',"
strText(0)=HMIRuntime.Tags("iYear2").Read
strText(1)=HMIRuntime.Tags("iMonth2").Read
strText(2)=HMIRuntime.Tags("iDay2").Read
strText(3)=HMIRuntime.Tags("iHour2").Read
strText(4)=HMIRuntime.Tags("iMinute2").Read
strText(5)=HMIRuntime.Tags("iSecond2").Read
strSql=strSql & "'" & strText(0) & "-" & strText(1) & "-" & strText(2) & " "
strSql=strSql & strText(3) & ":" & strText(4) & ":" & strText(5) & "'"
strSql="TAG:R,1," & strSql
有生之年,狭路相逢,终不能幸免