WillChangeRecord w/o reason
I am using VB 6.0, SP4, ADO 2.5 and Oracle 220.127.116.11.
I have bound a RecordSet to textboxes, datacombos and a datagrid using a client
side static cursor and optimistic locking:
Set adoPrimaryRS = DataEnv1.rstblSpender
adoPrimaryRS.CursorLocation = adUseClient
adoPrimaryRS.Open CursorType:=adOpenStatic, LockType:=adLockOptimistic
Even if I do not use the RecordSet of the data environment but create the
RecordSet manually it does not solve my problem:
It's only the first record of my RecordSet which is quite puzzling me:
Each time when I just press a simple button on the form, which does not alter the
contents of my bound textboxes or datacombos the WillChangeRecord event handler
is called two times, the first time with adReason = 11 (adRsnFirstChange) and the
second time with adReason = 3 (adRsnUpdate). Of course, this update will raise an
Oracle error for all users without update privileges.
If I am pressing a MoveNext button to perform a rs.MoveMext the following series
1. WillChangeRecord with adReason = adRsnFirstChange
2. WillChangeRecord with adReason = adRsnUpdate
for all following MoveNext commands with the same RecordSet only MoveComplete is
called, which is what I really want!
Even if I use a rs.CancelUpdate prior to the first MoveNext I cannot prevent my
program from calling WillChangeRecord and updating my Oracle table!
Has anyone an idea how to avoid updating the first record in the RecordSet?
Thanks a lot.