执行这个命令就出现报错
Private Sub Command6_Click()
Adodc1.RecordSource = "select time as t,i as current,v as voltage from ssmiv where time between " & DTPicker1.Value & "and " & DTPicker2.Value & " order by time "
Adodc1.Refresh
Set MSChart1.DataSource = Adodc1
' MSChart1.TitleText = "time"
End Sub报错弹出窗口!!!
---------------------------
Adodc1
---------------------------
[MySQL][ODBC 3.51 Driver][mysqld-5.0.45-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select time as t,i as current,v as voltage from ssmiv where time between 2010-1-' at line 1
---------------------------
确定
---------------------------
cn.ConnectionString = "DSN=myodbc;"cn.Open
sql = "select * from ssmiv"
rs.Open sql, cn, adOpenKeyset, adLockOptimistic
rs.AddNew'For i = 0 To Adodc1.Recordset.RecordCount - 1
'Combo1.AddItem Adodc1.Recordset.Fields(0).Value
'Adodc1.Recordset.MoveNext
' Next i
For i = 1 To 3 'Adodc1.Recordset.RecordCount - 1
Combo1.AddItem Adodc1.Recordset.Fields(i).Name
Adodc1.Recordset.MoveNext
Next iCombo1.Text = Combo1.List(1)
End Sub
scmd="select time as t,i as current,v as voltage from ssmiv where time between " & DTPicker1.Value & "and " & DTPicker2.Value & " order by time "
debug.print scmd
把SCMD拿到MySQLQueryBrowser中执行一下,看看是哪里出错了?