Re: Cannot update a disconnected (and then re-connected) ADO recordset bound to Access 2003 form
- From: "Yarik" <yarik@xxxxxxxxxx>
- Date: 7 Dec 2006 20:53:47 -0800
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.
.
- Follow-Ups:
- References:
- Prev by Date: Please help - find function fails in spreadsheet control on the access form
- Next by Date: Transactional processing with data-bound MS Access forms - how?
- Previous by thread: Re: Cannot update a disconnected (and then re-connected) ADO recordset bound to Access 2003 form
- Next by thread: Re: Cannot update a disconnected (and then re-connected) ADO recordset bound to Access 2003 form
- Index(es):
Relevant Pages
|