View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
John.Greenan John.Greenan is offline
external usenet poster
 
Posts: 175
Default ADO Connection vs Recordset objects.

If my answer helped then can you mark it as helpful please?

--
www.alignment-systems.com


"DaveO" wrote:

Thanks John.

I guessed there would be timing / resource issues, but wasn't fully sure.

"John.Greenan" wrote:

You do not have to create a connection object explicitly, you can called
recordset.open and send in a string for the connection. But this is slow -
you are better off creating the connection once and reusing the existing
connection (in a typical client server set up) rather than creating a
connection each time you want to open a recordset (this is not the case for
'large systems' where you need to be cute about utilising scarce resources
like connections).

Also, if you create the connection first then you can see if the connection
has worked and trap for that error nicely, rather than running an open
statement and have to trap for connection related errors and also for
database level errors.

There are a few articles on the MSDN that will help
--
www.alignment-systems.com


"DaveO" wrote:

If I make a connection to a db via ADO, I would need to then make a reference
to a recordset that I wished to interrogate / interact with.

Using the recordset object you don't necessary need to using the Connection
object to get at the same data as in the example above.

I can see that if you wish to manipulate data in several recordsets in the
from the same source then opening a connection would make sense.

What, if any, are the real differences??

TIA.