PDA

View Full Version : خاصیت record locks



parsa70
دوشنبه 24 آذر 1399, 13:40 عصر
سلام و احترام

ببخشید من یک جایی یک مطلب با این موضوع ذیل شنیده بودم گفتم بگم شاید به درد بقیه هم بخوره و خودمم مطئمن شم که درست هست یا غلط.
موضوع این هست که
تو تب دیتا مشخصات هر فرم قسمت record lock اون پایین اگه روی حالت:
اول یعنی اگر record lock روی حالت no locks باشه تو شبکه اگه دو نفر در حال وارد کردن دیتا ی فرم در یک رکورد باشن و یکی دیتا وارد کنه اکسس به نفر دوم پیام میده که نمی تونه اون نفر دیتا وارد کنه.
اگه حالت دوم record lock حالت all records باشه که یعنی به هیچ وجه دو نفر همزمان نمیتونن دیتا وارد کنن.
و حالت سوم record lock حالت edited records باشه دو یا چند نفر میتونن همزمان توی فرم دیتا وارد کنن به شرط اینکه همزمان توی یک رکورد از فرم دیتا وارد نشه.

میخواستم بدونم این مطلب آیا درست هست؟؟ و فکر کنم بهترین حالت همون حالت سوم باشه در در صورتیکه مطلب درست باشه؟؟
آیا به غیر از access database قسمت‌های دیگه ای هم میشناسید که توی شبکه تاثیر باشه مثل همین موضوع یا خیر؟
سپاس

padide55
سه شنبه 25 آذر 1399, 09:42 صبح
سلام

این هم کد بیسیک


Forms("myform").RecordLocks = 0
Forms("myform").RecordLocks = 1
Forms("myform").RecordLocks = 2
به ترتیب



(Default) In forms, two or more users can edit the same record simultaneously. This is also called "optimistic" locking. If two users attempt to save changes to the same record, Microsoft Access displays a message to the user who tries to save the record second. This user can then discard the record, copy the record to the Clipboard, or replace the changes made by the other user. This setting is typically used on read-only forms or in single-user databases. It is also used in multiuser databases to permit more than one user to be able to make changes to the same record at the same time.

No Locks

0



All records in the underlying table or query are locked while the form is open in Form view or Datasheet view. Although users can read the records, no one can edit, add, or delete any records until the form is closed.

All Records

1



(Forms and queries only) A page of records is locked as soon as any user starts editing any field in the record and stays locked until the user moves to another record. Consequently, a record can be edited by only one user at a time. This is also called "pessimistic" locking.

Edited Record

2