469,271 Members | 1,755 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Can you call an Access Query from ADO?

I can read/write etc from Access using the standard ADO connections.
When I fetch data from tables based on input data in a web form, all is
well.
I usually create the query in Access, then copy, paste and reformat to
VBScript.
However, there is one case where I have a query which uses another Query as
it's source. This doesn't seem to fly very well!
Is there a way to retrieve a recordset from an Access Query instead of a
Table?

I hope this is the right forum for this and apologies if not.

Thanks you.

Rusty
Nov 13 '05 #1
4 11089
"RustyR" <ru****@nortelnetworks.com> wrote
Is there a way to retrieve a recordset from an Access Query instead of a
Table?

rs.Source = "EmployerNameQuery"
rs.Open , CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly,
adCmdStoredProc
--
Darryl Kerkeslager

Power corrupts.
Absolute power corrupts absolutely.
Knowledge is power.
See www.adcritic.com/interactive/view.php?id=5927
Nov 13 '05 #2
Thanks! That works perfectly which leads me to another question...

What about Parameter Queries via ADO? Doable?

Regards,

Rusty
"Darryl Kerkeslager" <ke*********@comcast.net> wrote in message
news:VO********************@comcast.com...
"RustyR" <ru****@nortelnetworks.com> wrote
Is there a way to retrieve a recordset from an Access Query instead of a
Table?

rs.Source = "EmployerNameQuery"
rs.Open , CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly,
adCmdStoredProc
--
Darryl Kerkeslager

Power corrupts.
Absolute power corrupts absolutely.
Knowledge is power.
See www.adcritic.com/interactive/view.php?id=5927

Nov 13 '05 #3
Yup. See, for instance,
http://msdn.microsoft.com/library/en...medcommand.asp

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"RustyR" <ru****@nortelnetworks.com> wrote in message
news:d0**********@zcars0v6.ca.nortel.com...
Thanks! That works perfectly which leads me to another question...

What about Parameter Queries via ADO? Doable?

Nov 13 '05 #4
"RustyR" <ru****@nortelnetworks.com> wrote
Thanks! That works perfectly which leads me to another question...

What about Parameter Queries via ADO? Doable?


Certainly.

A Google search of this NG for

Here is a short snippet from this NG
with cmd
.ActiveConnection=CurrentProject.Connection
.CommandType = adCmdStoredProc
.CommandText = "qryPrm"
.Parameters.Append .CreateParameter( _
"prmCategoryName", adChar, adParamInput, 9, "beverages")
end with
Set rst = New ADODB.Recordset
rst.Open cmd, , adOpenKeyset, adLockOptimistic

--
Darryl Kerkeslager

Power corrupts.
Absolute power corrupts absolutely.
Knowledge is power.
See www.adcritic.com/interactive/view.php?id=5927

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by akmal chaudhri | last post: by
6 posts views Thread by Martin Lacoste | last post: by
8 posts views Thread by Jimbo | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.