473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 11249
"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...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.