Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


set recordset returned by command.execute to a datagrid

Posted on 2004-10-21
Medium Priority
Last Modified: 2010-08-05
I would like to know, if a recordset is derived from command.execute, how to get it into a datagrid?

my current code is like this:

dim rs as recordset
dim cmd as new command

set cmd.activeconnection = cn ' a valid connection
cmd.commandtext = "......" ' a valid sql statement

set rs = cmd.execute(,,adAsyncExecute)

'here is what I tend to do:
set datagrid1.datasource = rs
'it fails on 'rowset is not bookmarkable...'

I know if I use rs.open, it will be ok, like this:
set rs = new recordset
rs.open "....",cn, adOpenStatic, adLockReadOnly
set datagrid.datasource = rs
but I don't want to do this because I need the 'adAsyncExecute' - to execute  the command asynchronously.

Thanks for your help

Question by:ChenChen
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
  • 3

Accepted Solution

Rick_Townsend earned 2000 total points
ID: 12376590
You should be able to use adAsyncExecute after the locktype in recordset.open command.

rs.open "....",cn, adOpenStatic, adLockReadOnly, adAsyncExecute

Expert Comment

ID: 12376593

Expert Comment

ID: 12376602
The equivalent in command.execute is adAsynchFetch

See this link for specs:

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 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