Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Context: Windows 7, SQL Server 2000, JScript.

I have a recordset opened as follows:

var cmd = "SELECT * FROM Table1 WHERE Field1 = 9 AND Field2 = 0;";
var oRS = new ActiveXObject("ADODB.Recordset");
oRS.Open(cmd, oConn, adOpenDynamic, adLockOptimistic, adCmdText);

I traverse the recordset using

for ( ; !oRS.EOF; oRS.MoveNext() ) {

While I'm traversing, can I open another view into Table1 and update its values without affecting the traversal? The field being updated is not one of those used in the original SELECT. For example:

var oSEC = oConn.Execute("SELECT Field3 FROM Table1 WHERE Field4 = 1;");
if (!oSEC.EOF) {
    oSEC("Field5").Value = 2;
share|improve this question
...try it and let us know? –  Jon Seigel Mar 8 '13 at 18:29
I would expect since you are using adLockOptimistic on the original recordset that no long-term read locks are taken; therefore you could certainly update the table with the second statement. If you have already read past the affected record, you will not see the change inside the first recordset. However, if you have not yet read the modified row, you will see the modification in the first recordset once it is read. –  Max Vernon Mar 8 '13 at 18:37
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.