Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: COM/DCOM/COM+
Expertise: Beginner
Apr 13, 2000

Returning Recordsets From COM Components

Question:
I have heard from some that it is a bad idea to return recordsets from COM components and that you should populate a variant array and send that back to the ASP page instead. Others have said that MTS handles the connection pooling (and all those other MTS features), regardless. Returning a recordset is easier, but what difference does it make?

Answer:
I personally like sending back disconnected recordsets from my components. You don't have to worry about maintaining the database connection, plus you don't have to mess with the Variant array method.
I'm not sure what the party line is these days, but changing the CursorLocation property to adUseClient and then setting the ActiveConnection to Nothing disconnects the recordset. I use this quite successfully in a number of components I currently have running. I let MTS manage a separate component that maintains a database connection and returns disconnected recordsets as needed.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date