发表于:2006-08-24 14:29:00
楼主
采用excel制作,在查询时总是出现错误提示
FIX-HIStoricaldata access-odbc driver
expectes lexical element not found
部分代码如下,不知哪位高手知道解决方法
Dim rsADO As New ADODB.Recordset
Dim cnADO As New ADODB.Connection
Dim SQL1 As String
Dim strStartTime
Dim strEndTime
Interval = user.Interval.CurrentValue
strStartTime = user.strStartTime.CurrentValue
strEndTime = user.strEndTime.CurrentValue
SQL1 = "select fix.DATETIME,fix.TAG,fix.VALUE from fix where fix.value>0 and fix.interval='" + Interval + _
"' and (fix.datetime > {ts'" + strStartTime + "'}) and (fix.datetime < {ts'" _
+ strEndTime + "'})"
With cnADO
.Open "Provider=MSDASQL.1;Extended Properties='DSN=FIX Dynamics Historical Data;DBQ=;SERVER=NotTheServer'"
.Execute SQL1
End With