我正在尝试在查询中查找字段。这是我的代码:
Dim dbs As dao.Database
Dim qdf As dao.QueryDef
Dim rst As dao.Recordset
Dim strSQL As String
strSQL = "SELECT * from [qselCsvTxt] WHERE [Field] = 'AMOUNT'"
Set dbs = CurrentDb()
Set qdf = dbs.CreateQueryDef("", strSQL)
With qdf
Set rst = .OpenRecordset(dbOpenSnapshot)
With rst
.MoveLast
i = .Fields(0)
.Close
End With
End With
我在.OpenRecordSet
收到错误。
参数太少。预计1
如果我不给出where子句,它就可以正常工作。