472,368 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,368 software developers and data experts.

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 11205
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: akmal chaudhri | last post by:
Call for papers dataX International Workshop on Database Technologies for Handling XML information on the Web March 14, 2004, Heraklion, Crete (Greece) ...
6
by: NB | last post by:
Hi Is there any way to call up the query design view from code? In my compiled-as-MDE app everything is hidden from end users. However, I want advanced user to have access to the query design...
6
by: Martin Lacoste | last post by:
Ok, before I headbutt the computer... don't know why when I add criteria in a query, I get an 'invalid procedure call'. I also don't know why after searching the help in access, the various access...
7
by: Tim ffitch | last post by:
Hi I have created a VB dll file that contains common functions I use across various projects in VB, Access and Excel. Rather than have to code the functions in each I decided to use the dll...
8
by: Jimbo | last post by:
I have a form in access 97 that is populated by a query against some sql server tables....when ever the query pulls up only one record im fine..however if it pulls up more than one record i have...
2
by: Electric Bliss | last post by:
Greetings all... This has been driving me nutz and I was hoping an expert could help shed some light. Why does this query work in Access but not in an OleDbCommand.ExecuteReader() call? ...
10
by: tlyczko | last post by:
Hello, We have Access databases (backends) that will eventually be consolidated into a SQL Server database, to facilitate data reporting, analysis, etc. Some queries in one Access database...
5
by: marcsirois | last post by:
I have an SQL Query that looks like this. I simplified it for the purpose of this example, but it's still a runnable query SELECT TOP 1 FundedPositions.PositionNumber AS , (select top 1...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.