J
jb
I have a select query in my A2K database called qryTest. If I double-click
on
this, it brings up a recordset of records based on the criteria of the
query. However, in code, if I do a
Set rstMySet = dbcurrent.OpenRecordSet("qryTest")
I get an error "too few parameters: Expected 1" (dbcurrent & rstMySet
already defined). This query is based on an ODBC link to a third party
database.
So, I created a strSql string variable, copied the contents of
the query into that variable and touched up the quotes, etc., and then tried
the openrecordset(strSql) and
that gave me the same message.
If I go and make a simple query that returns records out of an Access
table (qryTest2) and not through ODBC, the openrecordset(qryTest2) works
fine. Is it because of
ODBC or is their something missing? I've tried adding some constants too
after the qryTest like dbopenforwardonly or dbopensnapshot, etc, but no luck
there either. Again, if I click on the query from the database window, it
opens fine and selects the correct group of records.
Thanks for any help.
John
on
this, it brings up a recordset of records based on the criteria of the
query. However, in code, if I do a
Set rstMySet = dbcurrent.OpenRecordSet("qryTest")
I get an error "too few parameters: Expected 1" (dbcurrent & rstMySet
already defined). This query is based on an ODBC link to a third party
database.
So, I created a strSql string variable, copied the contents of
the query into that variable and touched up the quotes, etc., and then tried
the openrecordset(strSql) and
that gave me the same message.
If I go and make a simple query that returns records out of an Access
table (qryTest2) and not through ODBC, the openrecordset(qryTest2) works
fine. Is it because of
ODBC or is their something missing? I've tried adding some constants too
after the qryTest like dbopenforwardonly or dbopensnapshot, etc, but no luck
there either. Again, if I click on the query from the database window, it
opens fine and selects the correct group of records.
Thanks for any help.
John