Invalid bookmark error after recordset delete then movenext

Invalid bookmark error after recordset delete then movenext

Post by Don Garci » Mon, 08 Jan 2001 03:53:35



Hi,
I have a question that has been bothering my team.
We just converted from SQL Server 6.5 to 7.0.
We inherited some code that seemingly worked under 6.5.
The recordset data was retrieved, then looped to delete each record.
The code is as follows:
    With rst
        .Open strSQL, madoConn, adKeyset, adLockBatchOptimistic
        While Not .EOF
            .Delete
            .MoveNext        'Invalid bookmark error happens here
        Wend
    End With

Under SQL 6.5, the records were deleted correctly after an .UpdateBatch
call.
Under SQL 7.0, the loop iterates through the recordset but eventually the
.MoveNext
method will cause an Invalid Bookmark error. (NOTE: I know that a simple
delete statement
against the connection will do the same job, but we can't do anything with
the code because
the app is in production. This will be fixed in the next release.)
Why is this happening and can it be fixed with service packs?
We are using the following drivers:
    OLEDB provider: MSDASQL    (We will use the SQLOLEDB provider on the
next release)
    MDAC 2.1 sp1

Thanks in advance,
Don Garcia  MCSD, MCDBA
Senior Consultant
Software Architects, Inc.

 
 
 

Invalid bookmark error after recordset delete then movenext

Post by Don Garci » Mon, 08 Jan 2001 04:06:05


Hi,
I have a question that has been bothering my team.
We just converted from SQL Server 6.5 to 7.0.
We inherited some code that seemingly worked under 6.5.
The recordset data was retrieved, then looped to delete each record.
The code is as follows:
    With rst
        .Open strSQL, madoConn, adKeyset, adLockBatchOptimistic
        While Not .EOF
            .Delete
            .MoveNext        'Invalid bookmark error happens here
        Wend
    End With

Under SQL 6.5, the records were deleted correctly after an .UpdateBatch
call.
Under SQL 7.0, the loop iterates through the recordset but eventually the
.MoveNext
method will cause an Invalid Bookmark error. (NOTE: I know that a simple
delete statement
against the connection will do the same job, but we can't do anything with
the code because
the app is in production. This will be fixed in the next release.)
Why is this happening and can it be fixed with service packs?
We are using the following drivers:
    OLEDB provider: MSDASQL    (We will use the SQLOLEDB provider on the
next release)
    MDAC 2.1 sp1

Thanks in advance,
Don Garcia  MCSD, MCDBA
Senior Consultant
Software Architects, Inc.


 
 
 

1. Invalid bookmark error after recordset delete then movenext

Hi,
I have a question that has been bothering my team.
We just converted from SQL Server 6.5 to 7.0.
We inherited some code that seemingly worked under 6.5.
The recordset data was retrieved, then looped to delete each record.
The code is as follows:
    With rst
        .Open strSQL, madoConn, adKeyset, adLockBatchOptimistic
        While Not .EOF
            .Delete
            .MoveNext        'Invalid bookmark error happens here
        Wend
    End With

Under SQL 6.5, the records were deleted correctly after an .UpdateBatch
call.
Under SQL 7.0, the loop iterates through the recordset but eventually the
.MoveNext
method will cause an Invalid Bookmark error. (NOTE: I know that a simple
delete statement
against the connection will do the same job, but we can't do anything with
the code because
the app is in production. This will be fixed in the next release.)
Why is this happening and can it be fixed with service packs?
We are using the following drivers:
    OLEDB provider: MSDASQL    (We will use the SQLOLEDB provider on the
next release)
    MDAC 2.1 sp1

Thanks in advance,
Don Garcia  MCSD, MCDBA
Senior Consultant
Software Architects, Inc.

2. MS SQL and Delphi 3 - hang on open

3. MoveNext Gives error 'Invalid bookmark'

4. ANN: New Online Master of Science in Data Mining

5. URGENT: Ado Recordset + Filter / MoveNext/Bookmark

6. email facility thru Sql Server

7. Recordset.MoveNext causes 'bookmark is invalid' error

8. Error 3159 - Invalid Bookmark

9. Jet Error Assigning Invalid Bookmark

10. Invalid bookmark error

11. Run Time Error 3159 - Invalid Bookmark - MS Access 97

12. DAO Error: Invalid Bookmark!