Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tracking changes using ADO

Status
Not open for further replies.

Yazster

Programmer
Sep 20, 2000
175
CA
Hi everybody.

I was wondering if there was a way of finding out if any changes were made to a database in a multi-user environment.

For example, if one user was looking at a certain record, and another user deleted that record at the same time, is there a way of making the change reflect in the first user's system?

When I populate my recordset I have the LOCKTYPE as ADLOCKOPTIMISTIC and the CURSORTYPE as ADOPENDYNAMIC. I'm not using the DATA control.

Thanks,
Yazster
 
The cursortype adOpenDynamic enables the recordset to dynamically change if the underlying data changes. In other words, if a record changes this will affect your recordset, wich, if I understand you correctly, is what you want.

The combination of adOpenDynamic and the locktype adLockOptimistic may result in errors, as you do not actually lock your record when editing them. Thus other users may alter the underlying data in the time between you edit the record and call Update.
This will result in an error, wich you should handle.

Good Luck!
-Mats Hulten
 
If you truly want to see the changed data on your form you should also write some Recordset.Update and Recordset.Refresh code to ensure the records are visually updated to ALL users.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top