WillChangeRecord w/o reason 
Author Message
 WillChangeRecord w/o reason

I am using VB 6.0, SP4, ADO 2.5 and Oracle
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
will occur:
1. WillChangeRecord with adReason = adRsnFirstChange
2. WillChangeRecord with adReason = adRsnUpdate
3. MoveComplete

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.

Sat, 29 Nov 2003 21:27:01 GMT  
 [ 1 post ] 

 Relevant Pages 

1. ADO Data Control WillChangeRecord Method example

2. WillChangeRecord Event ?????

3. WillChangeRecord code

4. ADO Data Control WillChangeRecord method example

5. TRapping errors in WillChangeRecord

6. GPF in event WillChangeRecord ADO 2.0

7. Problems w/ ADODB Recordset CancelUpdate and WillChangeRecord

8. Help with WillChangeRecord Event Error

9. ADO WillChangeRecord adStatus = adStatusCancel...ERROR!

10. GPF in event WillChangeRecord ADO 2.0

11. WillChangeRecord event of ADO Data Control

12. CancelUpdate in the WillChangeRecord Event


Powered by phpBB® Forum Software