[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

use recordset.close for adodb.connection?

Posted on 2004-11-01
2
Medium Priority
?
522 Views
Last Modified: 2012-06-27
'If I make an object called cn:

set cn = server.createobject("adodb.connection")

'Then open the connection:

cn.open dsnStr

'Then make a recordset object:

set rs = cn.execute("select * from master..syscolumns")

'Then use the rs object

rsArray = rs.getrows

'Then close the rs:

rs.close

'Then destroy the rs object:

set rs = nothing

'Then close the cn object:

cn.close

'Then destroy the cn object:

set cn = nothing


My question is: do I have to close the rs object, or do I just have to close the cn object?

When I use the rs.close command it 'logs off' from the SQL server (at least that's what sql profiler says) then 'logs on' when the next rs object is created. When I have a few rs's to create it 'looks' like it runs slow (in sql profiler) because of all the logging on and off, if I don't use the rs.close() command this 'log on/off' crap dosen't occur... as much.

What is this 'log on' 'log off' event in profiler?  What should I be doing?  Is it wrong to rs.close?  Is it wrong not to rs.close?

Thanks for the help

-Coolhand2120
0
Comment
Question by:Coolhand2120
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
suramsureshbabu earned 2000 total points
ID: 12469353
0
 
LVL 2

Author Comment

by:Coolhand2120
ID: 12469554
Thanks a lot, thats some good reading!

-Coolhand2120
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question