set recordset returned by command.execute to a datagrid

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, it will be ok, like this:
set rs = new recordset "....",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

Who is Participating?
Rick_TownsendConnect With a Mentor Commented:
You should be able to use adAsyncExecute after the locktype in command. "....",cn, adOpenStatic, adLockReadOnly, adAsyncExecute
The equivalent in command.execute is adAsynchFetch

See this link for specs:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.