Results 1 to 3 of 3

Thread: ADODB Recordset Update

  1. #1
    Guest
    Hi:
    I have the following piece of code which works well under SQL Server 6.5. But it gives a "Cursor is Read Only" error at the Update statement under SQL Server 7.0.

    Set rsheader = New ADODB.Recordset
    rsheader.Open strSQL, cnnODBC, adOpenDynamic, adLockOptimistic
    Do While Not rsheader.EOF
    rsheader.Update "Status", "P"

    ' more code here

    rsheader.movenext
    loop

    Could somebody let me know what is wrong in the above code?
    Thanks.

  2. #2
    Addicted Member
    Join Date
    Sep 1999
    Posts
    154
    I don't know for sure but I have had the same types of problems with SQL (7.0). You might want to try and change the CursorLocation. There are two settings adUseClient and adUseServer. I would try and change this and see what happens. I am finding however, that sometimes you lose the ability to use the AbsolutePosition and RecordCount when CursorLocation is not set properly.

    The other thing you might try is a different Provider to connect to the Server. Some providers behave differently.

  3. #3
    Guest
    I changed the value of recordset.CursorLocation from the default adUseServer to adUseClient and that solved my problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width