[AccessD] DAO vs ADO

Charlotte Foust cfoust at infostatsystems.com
Tue May 15 11:50:08 CDT 2007


You've had better luck than I then.  But I was specifically referring to
trying to do things like creating an ADO recordset and using DAO
parameters.

Charlotte 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Tuesday, May 15, 2007 8:31 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] DAO vs ADO

Charlotte,

>You can use both DAO and ADO in the same project but you can't mix them

>in
the same routine.

You absolutely CAN "mix them in the same routine".  The dimension
statement binds the variable to the correct object in the correct
library and both can be used "at the same time".

Function MixItUp()
	dim rstADO as ADODB.Recordset
	dim rstDAO as DAO.recordset

	.Initialize the ADO recordset here
	.
	.Initialize the DAO recordset here

	'Use both recordsets here for manipulating their specific
data...

End function


John W. Colby
Colby Consulting
www.ColbyConsulting.com
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte
Foust
Sent: Tuesday, May 15, 2007 11:11 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] DAO vs ADO

The most essential difference is that DAO is optimized for the Jet
engine and knows all about Access objects like controls, forms, reports,
etc.  ADO is a more generic data handling model, and it handles that
role much better than DAO in many cases.  You can use both DAO and ADO
in the same project but you can't mix them in the same routine.  If you
use both, you need to specifically declare objects as DAO or ADODB (or
ADOX, if necessary) because the two model have objects of the same name
but different methods and properties.  I think your last question is a
misunderstanding.  When working with an ADP, which is an Access FE
directly to SQL Server without linked tables, ADO is necessary.  You
can't pass objects back and forth between ADO and DAO.  DAO can't handle
an ADO recordset and vice versa.

Charlotte Foust

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Hewson
Sent: Tuesday, May 15, 2007 7:18 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] DAO vs ADO

I'm confused when looking at these two libraries.  My questions are
many, so I listed only a few below.
1.  What is the difference?  Yeah I know, this is a loaded question, but
how do I know when looking at code it's either one?
Can they be mixed?

2.  Which is recommended for MDBs - or is there no difference in
performance?

3.  I read somewhere, that ADO is required for ODBC to SQL Server with
an Access FE - is that correct?

That's enough for now, Thanks!

Jim
 
Jim H. Hewson
Applications Support Manager
Karta Technologies, Inc.
5555 Northwest Parkway
San Antonio, Texas 78249
210-582-3233
jhewson at karta.com
 

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list