Results 1 to 5 of 5

Thread: ADO Error on .update VB6/MySQL

Threaded View

  1. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2007
    Posts
    23

    Re: ADO Error on .update VB6/MySQL

    Hi,

    thank you so much for your answer.

    I wanted to use .adUseServer but i had several problems, the application i am redoing here has a multiplechoice test which uses .bookmark and .recordcount quiet often and it would be alot of work to redo all that code completly. I could get around the .recordcounts by using "Select Count (*)" but still i would have problems with the .bookmark, i couldnt get them working on .adUseServer.

    That`s why i was using .adUseClient. In this example a .bookmark is used to move to a certain position in the table to update a couple of rows that are on one page in the mutliplechoice test. Only using executes here would cause alot of work on the whole structure of that mutiplechoice test system.

    I even created a temporary table and opened it with the adlockpessimistic, only i knew the tmptable name and only that recordset was using the table and still i get the damn -2147217864 Row cannot be located for updating, some values may have been changed since it was last read.

    Code:
    Dim adoTMP As ADODB.Recordset
    
        adoTMP.CursorType = adOpenDynamic
        adoTMP.CursorLocation = adUseClient
        adoTMP.LockType = adLockPessimistic
    
        adoTMP.ActiveConnection = dbs
    
        adoTMP.open "Select " & FB_Fields & " FROM tmp_be"
    
       ....
    
        adoTMP.Bookmark = bkm(curNr)
    
       dbs.begintrans
        For Fid = 1 To DSPos2 - DSPos1
            adoTMP.Fields("Txt").Value = TextH(Fid).Text
            adoTMP.Fields("FNote").Value = Val(TxtNote(Fid).Text)
            adoTMP.Fields("Hken").Value = Checkbox(Fid).Value
            'adoTMP.Update not really needed
            adoTMP.MoveNext
        Next Fid
      dbs.comittrans
    
       adoTMP.close
    It was a really bad idea how it was done be the original author who developed that tool here a couple of years ago...and i have to suffer now.

    Thx again for your input
    oli

    Edit: thx for your database tutorials i will start going through them...
    Last edited by Wahnsinnig; Feb 24th, 2009 at 05:41 AM.

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