local recordset

G

Guest

Just a quickie: I'm so used to calling recordsets from SQL server, I've
forgotten how to do it with a local Access table (in the same app, not
linked). Do I need to declare and set a DAO recordset? Like:

Set rst = db.OpenRecordset(strSQL, dbOpenSnapshot)

What if I'm trying to eliminate DAO in favor of ADO? ADO seems like a lot of
trouble for a local table.

Thanks as always!!
 
G

Guest

Hi, Sam.
Set rst = db.OpenRecordset(strSQL, dbOpenSnapshot)

This is fine, as long as rst is a DAO.Recordset Object. You'll need to set
a reference to the DAO library, and if you don't put the DAO library as
higher in precedence than the ADO library in the References Collection,
you'll need to prefix the Recordset Object with the DAO qualifier:

Dim rst As DAO.Recordset

strSQL can be any string value that represents the name of a data source.
This can be a table name, query name, or SQL statement.
What if I'm trying to eliminate DAO in favor of ADO?

When dealing with Jet objects, use DAO. It's native to Jet. ADO is a
generic library to handle database connections, data sets, record locking and
transactions from many different types of data sources.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top