ADO Error : The specified row could not be located for updating 
Author Message
 ADO Error : The specified row could not be located for updating

Hi,

When I run this code in VB6, I have an error (see source code below) on
the second UpdateBatch line.
Can you tell me why? An how to solve this problem?

Thanks for your help,

Denis

------------
Source Code:
------------

Private Sub Command1_Click()
    '1. Add References "Microsoft ActiveX Data Objects 2.0 Library"
    '2. Copy Bilbio.mdb to "C:\Temp"
    '3. Run this program
    '4. Error Message = "The specified row could not be located for
updating:
    '                    Some values may have been changed since it was last
read."

    Dim mConnection As ADODB.Connection
    Dim mRecordset As ADODB.Recordset

    'Initialize
    Set mConnection = New ADODB.Connection
    Set mRecordset = New ADODB.Recordset

    'Open
    mConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security
Info=False;" & _
                     "Data Source=C:\Temp\Biblio.mdb"

    mRecordset.CursorLocation = adUseClient
    mRecordset.CursorType = adOpenDynamic
    mRecordset.LockType = adLockBatchOptimistic
    mRecordset.Open "Authors", mConnection, , , adCmdTable

    'Addnew
    mRecordset.AddNew
    mRecordset("Author") = "Hello"
    mRecordset.Update

    mRecordset.UpdateBatch

    'Update
    mRecordset("Author") = "Hello Updated"
    mRecordset.Update

    mRecordset.UpdateBatch

    'Terminate
    Set mConnection = Nothing
    Set mRecordset = Nothing

End Sub



Thu, 07 Jun 2001 03:00:00 GMT  
 ADO Error : The specified row could not be located for updating
I did not take a look on biblio.mdb.
But: If there is an autoincrement column on the author table, it is not possible
to use a clientbatch cursor type. The reason is very simple.
You create on your client the new records but with what column value in the
autoincrement column.? (always under the assumption that this table has one)
hpm
Quote:

> Hi,

> When I run this code in VB6, I have an error (see source code below) on
> the second UpdateBatch line.
> Can you tell me why? An how to solve this problem?

> Thanks for your help,

> Denis

> ------------
> Source Code:
> ------------

> Private Sub Command1_Click()
>     '1. Add References "Microsoft ActiveX Data Objects 2.0 Library"
>     '2. Copy Bilbio.mdb to "C:\Temp"
>     '3. Run this program
>     '4. Error Message = "The specified row could not be located for
> updating:
>     '                    Some values may have been changed since it was last
> read."

>     Dim mConnection As ADODB.Connection
>     Dim mRecordset As ADODB.Recordset

>     'Initialize
>     Set mConnection = New ADODB.Connection
>     Set mRecordset = New ADODB.Recordset

>     'Open
>     mConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security
> Info=False;" & _
>                      "Data Source=C:\Temp\Biblio.mdb"

>     mRecordset.CursorLocation = adUseClient
>     mRecordset.CursorType = adOpenDynamic
>     mRecordset.LockType = adLockBatchOptimistic
>     mRecordset.Open "Authors", mConnection, , , adCmdTable

>     'Addnew
>     mRecordset.AddNew
>     mRecordset("Author") = "Hello"
>     mRecordset.Update

>     mRecordset.UpdateBatch

>     'Update
>     mRecordset("Author") = "Hello Updated"
>     mRecordset.Update

>     mRecordset.UpdateBatch

>     'Terminate
>     Set mConnection = Nothing
>     Set mRecordset = Nothing

> End Sub



Wed, 20 Jun 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADO Error : The specified row could not be located for updating

2. - newbie - The specified row could not be located for updating

3. The spedified row could not be located for updating

4. Row cannot be located for updating ERROR ?

5. Error : Row cannot be located for updating ?

6. Error: Row cannot be located for updating ?

7. Row cannot be located for updating error

8. I am trying to update a record, i am not using data control

9. I am trying to update a record, i am not using data control

10. ADO not releasing row level lock after .Update

11. Error: ADO could not find specified provider

12. ADO could not find the specified provider Error!

 

 
Powered by phpBB® Forum Software