title: How does "set rs = conn.execute(sql)" actually work?
body: <p>I am at the moment trying to improve the performance in my ASP Classic application, and I am at the point of improving SQL transactions.</p>
  
  <p>I have been reading a little from <a href="http://www.somacon.com/p236.php" rel="nofollow">http://www.somacon.com/p236.php</a></p>
  
  <p>So, my question is:
  How does the line <code>set rs = conn.execute(sql)</code> actually work?</p>
  
  <p>I believe that the line defines a variable named <code>rs</code> and binding ALL the data collected from the database through the SQL sentence (fx <code>select * from users</code>).
  Then afterwards I can actually throw the database-connection to hell and redefine my sql variable if I please, is this true?</p>
  
  <p>If that is true, will I then get the best performance by executing my code like this:</p>
  
  <pre><code>set conn = server.createobject("adodb.connection")
  dsn = "Provider = sqloledb; Data Source = XXX; Initial Catalog = XXX; User Id = XXX; Password = XXX"
  
  conn.open dsn
  sql = "select id, name from users"
  set rs = conn.execute(sql)
  conn.close
  
  -- Do whatever i want with the variable rs
  
  conn.open dsn
  sql = "select id from logins"
  set rs = conn.execute(sql)
  conn.close
  
  -- Do whatever i want with the variable rs
  
  conn.open dsn
  sql = "select id, headline from articles"
  set rs = conn.execute(sql)
  conn.close
  
  -- Do whatever i want with the variable rs
  
  set conn = nothing
  </code></pre>
  
  <p>In this example i open and close the connection each time i do a sql transaction.</p>
  
  <p>Is this a good idea?</p>