469,946 Members | 1,826 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

VBA and multiple recordset

What is the best way to open run a query and then open a recordset,
for example.
Set rst = exDatabase.OpenRecordset(sql)

' Run Query
....
....
....
rst.Close

Set rst = exDatabase.OpenRecordset(another_sql)
....
....
....
rst.Close

This is the way I am doing it now, the sql are basically select
statements, nothing fancy.

Nov 13 '05 #1
1 2202
I'm afraid I don't understand your question.

SQL statements beginning with SELECT define recordsets; a recordset based on
such a query can be opened.

SQL statements beginning with INSERT, UPDATE, or DELETE can be run, but it
does not define a recordset which can be opened.

In order to run a query, there is no need to open a recordset.

HTH
- Turtle

"berlinbrown" <bi*****@hotmail.com> wrote in message
news:10**********************@c13g2000cwb.googlegr oups.com...
What is the best way to open run a query and then open a recordset,
for example.
Set rst = exDatabase.OpenRecordset(sql)

' Run Query
...
...
...
rst.Close

Set rst = exDatabase.OpenRecordset(another_sql)
...
...
...
rst.Close

This is the way I am doing it now, the sql are basically select
statements, nothing fancy.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by shank | last post: by
16 posts views Thread by Randy Harris | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.