What is the difference between Rs.Open and Rs.execute (RS is a Recordset object)? In some pages with set Rs=conn.execute () can not be used, some rs.open can not be used
The first one is that you can have different open cursors
The second cursor with only one forward
And the second you write is not quite correct it should be conn.execute, there is no rs.execute.
REXSP (True water without fragrance ppcode.com):
Sorry, it was written wrong, is set Rs=conn.execute (), if my cursor Conn.cursorlocation=3,set rs=conn.execute () and rs.open what is different?
Conn.execute execution is more efficient, especially in insert into, update and other operations!
There is a difference between the two modes of opening, which is the cursor problem mentioned earlier.
In general, the two are exchanged with each other, but sometimes, for example, you need to take rs.recordcount when you can only open it. I'm not quite sure what the other difference is. I am generally using execute, when I encounter problems with open
Usually Set rs=conn.execute (SQL) or direct rs=conn.execute (SQL)
and Set rs=server.createobject ("ADODB. Recordset ")
Rs.Open sql,conn,0,1 or Rs.Open sql,conn
In this case, open is usually a little bit better than the previous performance.
Use Conn.execute to execute the next set Rs=conn.execute (SQL) directly without shutting down
But the performance speed will be greatly reduced!!
About to slow 2~5 times!! (This is I in the MSSQL cycle 1000 times personally tested, do not believe you immediately test yourself), so execute the next rs=conn.execute before!! Be sure to shut it off! It's a good habit!
Use the RS Rs.Open of a single object before the Open next Recordset, you must require that the display be turned off, otherwise an error, the speed in the case of sql,conn,0,1, the former is basically the same
So I like to use just set a CreateObject ("Adodb.recordset") (without requiring multiple Recordset interleaved operations, multiple also does not matter!)
and use the tail!!! from the beginning.
Open the door and close the door ~~~~~ 咵 tread 咵 ~ ~ ~ ~ ~
Last set rs=nothing, cool!
More important is open to provide very flexible operation of the database metadata of very many attributes!!
Open hundred treasure box, gold Guangcan See what all!
There are many situations in which you have to do it with open!
and conn.execute like black cloth to change the film ~ ~ ~ ~ Very single!!!