Returning Recordsets From COM Components

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.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of