Browse DevX
Sign up for e-mail newsletters from DevX

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



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Returning Recordsets From COM Components

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?

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.



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