oRs=oConn.Execute("Select * FROM Books") while not ors.Eof strSQL = "Select * FROM Authors Where AuthorID="oRs("AuthorID") ors2=oConn.Execute(strSQL) Response.write ors("Title")">>"oRs2("Name")"br>" ors.MoveNext() wend
要比下面的代码慢:
strSQL="Select Books.Title,Authors.Name FROM Books JOIN Authors ON Authors.AuthorID=Books.AuthorID" ors=oConn.Execute(strSQL) while not ors.Eof Response.write ors("Title")">>"oRs("Name")"br>" ors.MoveNext() wend
[b]方法二、尽量避免使用可更新Recordset[/b]
oRs=oConn.Execute("Select * FROM Authors Where AuthorID=17",3,3) ors("Name")="DarkMan" ors.Update()
要比下面的代码慢:
strSQL = "Update Authors SET Name='DarkMan' Where AuthorID=17" oConn.Execute strSQL