CreateQueryDef Analog in ADO

S

Steve House

Since I like to stack queries in DAO, what is the analog of CreateQueryDef
in ADO so I can have one query call another whose definitions I set up in a
string?. Please give me an example of one query that calls another that is
created on the fly through a string.

Thanks in advance,

Steve House
(e-mail address removed)
 
P

Peter Yang [MSFT]

Hello Steve,

You could run "create table" command in ADO directly. I have inclued the
following article

199304 How to find a record using ADO and Jet OLE DB provider in Access 2000
http://support.microsoft.com/?id=199304

Hope this is helpful.

Thanks & Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security

=====================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| From: "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com>
| References: <[email protected]>
| Subject: Re: CreateQueryDef Analog in ADO
| Date: Tue, 4 Jan 2005 19:40:52 -0500
| Lines: 26
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1478
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.access.modulesdaovba.ado
| NNTP-Posting-Host:
cpe00104c12bf15-cm014500008513.cpe.net.cable.rogers.com 24.156.25.57
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15
phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.access.modulesdaovba.ado:15882
| X-Tomcat-NG: microsoft.public.access.modulesdaovba.ado
|
| Why not use DAO to create the queries?
|
| --
| Doug Steele, Microsoft Access MVP
|
| (no e-mails, please!)
|
|
|
| | > Since I like to stack queries in DAO, what is the analog of
CreateQueryDef
| > in ADO so I can have one query call another whose definitions I set up
in
| a
| > string?. Please give me an example of one query that calls another
that
| is
| > created on the fly through a string.
| >
| > Thanks in advance,
| >
| > Steve House
| > (e-mail address removed)
| >
| >
|
|
|
 
S

Steve House

Peter,

Thanks, but it seems like a great deal of work to get something that could
be created in one command in the older version of data queries. I'll keep
looking. As far as Douglas' question, I'm doing my best to stay ahead of
the curve since DAO will go the way of all old MS functionality. Though I
love Access, especially for their reports, I'm learning the latest VStudio
and the reports under SQL server.

Steve

Steve
 
N

Nick Coe \(UK\)

In Steve House typed:
Peter,

Thanks, but it seems like a great deal of work to get
something that
could be created in one command in the older version of
data queries.
I'll keep looking. As far as Douglas' question, I'm doing
my best to
stay ahead of the curve since DAO will go the way of all
old MS
functionality. Though I love Access, especially for their
reports,
I'm learning the latest VStudio and the reports under SQL
server.

Steve

Steve
message

DAO's back in A2003. Thank (insert deity of your choice).

Will it be further deprecated? Don't know.

It is well worth learning and experimenting with ADO but
since JDO has been deprecated it becomes less attractive for
Jet work.

--
Nick Coe (UK)
AccHelp v1.01 Access Application Help File Builder
http://www.alphacos.co.uk/
Download Free Copy
----
 
D

Douglas J. Steele

Futher to what Nick says, ADO has already been supplanted by ADO.Net,
whereas DAO is still around.

From what we can tell, Microsoft is admitting they made a mistake when they
were recommending using ADO instead of DAO in Access: the MS people with
which we have contact now seem to be recommending DAO in most cases. DAO was
designed specifically for Jet databases, whereas ADO is a "generic" access
method. DAO is almost always more efficient when used with Jet databases.
 
G

Graham R Seach

Tell that to a guy named Sean O'Neil, who flamed my book, saying "The
authors are old school in that they introduce an end of life data access
model (DAO) at length and then make endless and confusing references to it
while they document the current initiative, ADO."

:)

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 
G

Graham R Seach

Steve,

I agree with Doug, that you are better to use DAO, but if you're determined:

Dim cat As New ADOX.Catalog
Dim cmd As New ADODB.Command

'Open the Catalog
cat.ActiveConnection = CurrentProject.Connection

'Create the Command object that represents the View
cmd.CommandText = "SELECT * FROM tblMyTable"

'Create the View
Cat.Views.Append "qryMyQuery", cmd

'Clean up
Set cat.ActiveConnection = Nothing
Set cat = Nothing
Set cmd = Nothing

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top