ADO Connection vs Recordset objects.

G

Guest

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.
 
G

Guest

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
 
G

Guest

Thanks John.

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

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