Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ADO Connection vs Recordset objects.
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ADO Connection vs Recordset objects.
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ADO Connection vs Recordset objects.
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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
always recheck data connection library for latest connection strin | Excel Discussion (Misc queries) | |||
Disconencted recordset for DSN less connection | Excel Programming | |||
Connection Recordset Loop Problem with VBA - Help | Excel Programming | |||
VBA excel - problem with having clause in sql with adodb.connection/recordset | Excel Programming | |||
Missing: Microsoft ActiveX Data Objects Recordset 2.7 Library | Excel Programming |