Results 1 to 3 of 3

Thread: I want updata database of Microsoft Access but VB6.0 warning error

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    522

    I want updata database of Microsoft Access but VB6.0 warning error

    Code:
    Set objConnection = New ADODB.Connection
    objConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=App.Path & "\database.mdb";Persist Security Info=False;Jet OLEDB:Database Password="123"
    objConnection.Open
    Set rsData = New ADODB.Recordset
    rsData.Open "dulieuxuly", objConnection, adOpenKeyset, adLockOptimistic
    
    Dim i, j As Single
    
        j = 10
        For i = 1 To j Step 1
            rsData.AddNew
            rsData!Num = i
        Next
        rsData.Update
      'The command line in above very good but the command line below warning error
    
       j = 24
       rsDulieu.MoveFirst
       For i = 15 To j Step 1
           rsData!Num = i    ' Warning Error in here (A)
           rsData.MoveNext
       Next
       rsData.Update
    (A): The Microsoft Jet database engine stopped the process because you and another user are attempting to change the same data at the same time.
    I want to update fields rsData!Num = i , can you help me ?
    Last edited by Hack; May 2nd, 2009 at 07:06 AM. Reason: Add Code Tags

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