Re: Cannot update a disconnected (and then re-connected) ADO recordset bound to Access 2003 form

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Just a thought: rather than using CurrentProject.AccessConnection, try
opening a new connection object that explicitly has client-side cursors
e.g.

Set m_conn = New ADODB.Connection
With m_conn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "<<connection string here>>"
.CursorLocation = adUseClient
<<other connection properties here>>
.Open
End With

Jamie.

I did not try this, but I really, really doubt that this is because of
using a "wrong" of connection (CurrentProject.Connection, or
CurrentProject.AccessConnection, or my own connection).

The first reason of my doubt is that the connection I used did have its
adCursorLocation set to adUseClient.

The second (and probably the strongest) reason is that, after a closer
look at what happens to the recordset, I finally found one difference
that seems to be important. When updating the disconnected recordset
programmatically, the calls to Update() do not change the fields'
OriginalValue and UnderlyingValue properties. However, when the same
recordset (originally opened with the same connection) is "operated" by
the form, every record's update (e.g. when user moves to another
record) somehow changes the OriginalValue and UnderlyingValue
properties (namely, sets them equal to the Value property). More
specifically, in BeforeUpdate event handler, only the Valuer property
appears to have been changed, whereas within AfterUpdate handler, all
three values are the same. My theory is that (a) differences between
Value, OriginalValue, and UnderlyingValue is exactly what UpdateBatch()
uses to do actual changes and resolve possible conflicts and (b)
somehow form manages to misuse or abuse this mechanism.

What my theory still lacks is understanding whether this problem is
avoidable in MS Access 2003. Anybody?

BTW, if someone could confirm that this problem does or does not exist
in any newer version of MS Access (e.g. 2007), that would also be very
helpful.

Thank you,
Yarik.

.



Relevant Pages

  • Re: Application Role - aduseclient
    ... The only thing I can think of is if the recordset is opening ... It happens in ADO sometimes where a connection is ... >Set bestelcon = New Connection ... >As long as there is no "aduseclient or aduseclientbatch", ...
    (microsoft.public.sqlserver.security)
  • Re: Updating Access data using SQL / refresh time question
    ... As a test today, for one poarticular recordset, I changed from DAO to ADO to ... > I forgot to mention that the expense of repeated connection open and close ... > dim oconn as new adodb.connection ... > 'Now load the listview by looping through each RS row ...
    (microsoft.public.vb.database)
  • Re: Updating Access data using SQL / refresh time question
    ... > I forgot to mention that the expense of repeated connection open and close ... > dim oconn as new adodb.connection ... > 'Now load the listview by looping through each RS row ... > ' Set the recordset object each time we load the listview ...
    (microsoft.public.vb.database)
  • Re: Problem: MDB-Datenbank Zugriff über das Intranet
    ... Wie und wo öffnest Du Deine Connection zur *.mdb? ... > End With ... Du öffnest ein Recordset mit adOpenForwardOnly. ... Datensatz liegenden Datensatz zuzugreifen. ...
    (microsoft.public.de.vb.datenbank)
  • Re: ASP - FROM statement slows down connection to database
    ... Open your database in Access, switch to the Queries tab, create a new query ... in Design View without choosing a table, swtich to SQL View, paste the sql ... connection string rather than using an ... recordset open statements. ...
    (microsoft.public.inetserver.asp.db)