Recordset and connections

Experts,
In a simple ASP script, where you open one connection, then open two recordsets in a row

cnn.ConnectionString = "xxx"
cnn.CursorLocation = 3
cnn.Open
Set RS1 = cnn.Execute("select a from b")
Set RS2 = cnn.Execute("select c from d")
..... do some stuff with the results
RS1.close
RS2.close
cnn.close

After doing that, before closing RS1 or RS2, the active connection of each recordset is the same cnn first opened? Or ADO will automatically open a second connection, identical to cnn, for RS2?

I am seeing multple connections on my database and I suspect that it is happening. If you have many active recordsets, and they are all open, do I have many database connections ou just one? Disconnected recordset would help reduce open connections on the database?

Thanks in advance, Joao

LVL 1
jcsfreiAsked:
Who is Participating?
 
Ryan ChongConnect With a Mentor Commented:
for old version of ADO, before ADO.NET, you can open just 1 connection and can let many recordsets connect to it.
0
 
Carl TawnConnect With a Mentor Systems and Integration DeveloperCommented:
In that snippet you are using a single connection and issuing two separate commands, both of which use the same connection.
0
 
MuffyBunnyCommented:
From a database standpoint, multiple people accessing your site will show multiple concurrent processes on your database.
0
 
jcsfreiAuthor Commented:
tks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.