Question : Access VBA query returns error  "Too few parameters. Expected 1"

This issue seems to litter the net but I can't find an answer to my simple situation:

Using DAO in Access (ADO not referenced)

APscan is a simple table with an integer field Attempt

There are no PARAMETERS or REFERENCES to a FORM etc..

The command works fine in the Access SQL query screen just not here in Autocad.

For some reason changing the sqlstring to:

sqlstr = "SELECT * FROM APScan WHERE Processed Is Null;"

Works where processed is just another field in the table (Although in this case I only get one of the 3 entries that should qualify as NULL but that's probably another issue.)

Thanks

Peter Gillespie
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
Dim dbsObj As DAO.Database
Dim rstObj As DAO.Recordset
Set dbsObj = DAO.DBEngine.Workspaces(0).OpenDatabase("Update APShop.mdb")
sqlstr = "SELECT * FROM APScan WHERE Attempt > 1;"
Set rstObj = dbsObj.OpenRecordset(sqlstr, dbOpenSnapshot)
 
THE ERROR OCCURS ON THIS LAST LINE

Answer : Access VBA query returns error  "Too few parameters. Expected 1"

Please post the results of the following code in a code snippet window
1:
2:
3:
4:
5:
6:
7:
8:
Dim dbsObj As DAO.Database
Dim fldObj As DAO.Field
 
Set dbsObj = DAO.DBEngine.Workspaces(0).OpenDatabase("Update APShop.mdb")
 
For Each fldObject in dbsObj.TableDefs("APScan").Fields
   Debug.Print fldObj.Name
Next
Random Solutions  
 
programming4us programming4us