Re: Stale Data

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: JS (js_at_somewhere.com)
Date: 03/18/04


Date: Thu, 18 Mar 2004 13:52:54 +0700


the problem is if i change the stale data and call updatebatch, it will
raise an error tell me that 'The row can be located for update....'
but if i delete the stale data and then call updatebatch it just update
smoothly without raising an error that i expected.

here is my code:

Set conn = New ADODB.Connection
conn.CursorLocation = adUseClient
conn.Mode = adModeReadWrite
conn.ConnectionString = "Provider=MSDASQL.1;Data Source=DSApp;"
conn.Open

Set m_rs = New ADODB.Recordset
m_rs.CursorLocation = adUseClient

m_rs.Open strSQL, conn, adOpenKeyset, adLockBatchOptimistic, adCmdText
m_rs.Properties("Update Criteria").Value = adCriteriaAllCols
Set m_rs.ActiveConnection = Nothing

... after some modification or delete of data than

conn.BeginTrans
Set m_rs.ActiveConnection = conn
m_rs.UpdateBatch

conn.CommitTrans
Set m_rs.ActiveConnection = Nothing



Relevant Pages

  • Re: Stale Data
    ... > the problem is if i change the stale data and call updatebatch, ... > conn.CursorLocation = adUseClient ... > m_rs.Open strSQL, conn, adOpenKeyset, adLockBatchOptimistic, adCmdText ...
    (microsoft.public.data.ado)
  • Re: Stale Data
    ... Do you re-connect your recordset to the database before calling UpdateBatch? ... > thus how i can make sure that i try to delete the stale data ...
    (microsoft.public.data.ado)
  • Stale Data
    ... i have a disconnected rs and display the in grid ... updatebatch it doesn't raise an error. ... thus how i can make sure that i try to delete the stale data ...
    (microsoft.public.data.ado)