Opening a dynaset-type recordset

Posted on 2003-03-25
Medium Priority
Last Modified: 2013-12-25
I want to open a dynaset type recordset so that I can use the find methods (a table type recordset won't work for my purposes).  I have the following code run from a form:

Set cert_rst = CurrentDb.OpenRecordset("Cert_Log", dbOpenDynaset)

When I try to run the code, I get the message 'runtime error 3001: invalid argument'.  Cert_Log is a table in my database and it is spelled correctly.  I have used almost the exact same code in a different database with no problems.  That code looks like this:

Set props_rst = CurrentDb.OpenRecordset("Props", dbOpenDynaset)

The only difference between the 2 databases is that one of them is linked and has a front and back end and the other is not linked.  The one that is not linked is giving me the error message.  So I tried adding a linked table to that database and opening it as a dynaset.  I got the same error message.
In the non-linked database, it lets me open a table type recordset only if I use the default and don't specify the type.  If I add the argument 'dbOpenTable', I get the same error message.  Any ideas??????        
Question by:wasser
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8211728

Set cert_rst = CurrentDb.OpenRecordset("[Cert_Log]", dbOpenDynaset

Log may be a reserved word in SQL

It should be in there as your error is invalid argument


Author Comment

ID: 8212116
I tried using brackets around the table name and I'm still getting the same error message.  

Expert Comment

ID: 8212230
The problem must be else where in the code.

I cannot see anything wrong in the statement
Check your declarations and other preparatory code

If still a problem - post more of the code
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 8214510
I am trying to get this question deleted, as I have figured it out myself.  The problem was that the database did not have the DAO library added as a reference.  I thought it would be included automatically and didn't know I had to explicitly add it myself.  

Expert Comment

ID: 8216490
Well done

You usually get an error on declarations if you do not do this so I guess you had just pasted a bit of code in.


Expert Comment

ID: 8221905
My friend, your problem is
The DAO library only allow to create Dynaset or Snapshot over Linked tables or tables of external database ODBC.
You won't not create a Dynaset recordset with your not linked table


Expert Comment

ID: 8223501
Gustavo is I am afraid - totally incorrect

I run a software house and our entire software library is DAO based.

We have tested ADO and in for the businesses we support it far too slow. We are now awaiting the next version of VB.net which wil support DAO.

DAO will support linked and unlinked tables on a direct connection or an ODBC connection..

My apologies to Gustavo but he is perfectly welcome to come here for a few lessons.

Accepted Solution

modulo earned 0 total points
ID: 8224958
PAQ'd and 125 points refunded


Community Support Moderator
Experts Exchange

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month10 days, 23 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question