假设m_CityName(I, 2)="01001"
cSql = "Select city_id,year,mon,day,Sales From " & cDbfFile & _
"Where city_id='" & m_CityName(I, 2) & "' And (Year='2004' and Mon='01') order by Year "
大家看一下这条查询语句错在哪里,怎么改?
cSql = "Select city_id,year,mon,day,Sales From " & cDbfFile & _
"Where city_id='" & m_CityName(I, 2) & "' And (Year='2004' and Mon='01') order by Year "
大家看一下这条查询语句错在哪里,怎么改?
[Microsoft][ODBC Visual FoxPro Driver]SQL:Column '' is not found.
就查询语句通不过,大家再帮忙找一找。谢谢!
".DBF Where city_id='" & m_CityName(I, 2) & "' And (Year='2004' and Mon='01') order by Year "
忘了交代,cDbfFile =m_AppPath & "\dbf\2004.DBF"为自由表。
'=========================================
不要用全路径.
你的 CONN 只要连接到该文件所在的目录即可.
例如:
Function OpenDBFConn(WorkPath As String) As ADODB.Connection Dim DBFConn As New ADODB.Connection
Dim ConnStr As String
ConnStr = "DSN=Visual FoxPro Tables;SourceDB=" & WorkPath & ";SourceType=DBF"
DBFConn.Open ConnStr
Set OpenDBFConn = DBFConn
End Function
cDbfFile ="2004.DBF"
cSql = "Select city_id,[year],mon,[day],Sales " & _
"From " & cDbfFile & _
" Where city_id='" & m_CityName(I, 2) & "' And ([Year]='2004' and Mon='01') order by [Year]"
还是通不过!谢谢你!我再找一找,或者换用Access数据库来实现。