Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenRecordset error '3061'

Status
Not open for further replies.

jl2000

Programmer
Jul 23, 2002
1
CA
Hi,
I have a simple Access 2000 database and DAO 3.6 Library and I need get a record count from a existing query. But at run time I got an error:
OpenRecordset error '3061' Too few parameters. Expected 2.
Here is the code:

Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = DBEngine.Workspaces(0).Databases(0)

Set rs = db.OpenRecordset("My_Query_Name",dbOpenDynaset)

rs.MoveFirst
n = rs!Field_ToBeGet
rs.Close
Set db = Nothing

Even I fillup all optional field on openrecordset, it comes the same error message. I do need help. Thanks!
 
Thanks Rolliee!
May you tell me more about the error message, that whould be very help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top