Alison Balteramp;#039;s Mastering Microsoft Office Access 1002003 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Alison Balteramp;#039;s Mastering Microsoft Office Access 1002003 [Electronic resources] - نسخه متنی

Alison Balter

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



Prohibiting Users and Groups from Creating Objects


You might want to prevent the members of a workgroup from creating new databases or creating specific database objects. You can prevent users from creating databases or other objects only by using VBA code.

For example, you might want to prevent users from creating new tables, queries, or other objects in your application or data database files. Listing 28.29 illustrates this process.

Listing 28.29 Prohibiting Users from Creating Other Objects

Sub NoTables(strGroupToProhibit)
On Error GoTo NoTables_Err
Dim cat As ADOX.Catalog
Set cat = New ADOX.Catalog
cat.ActiveConnection = CurrentProject.Connection
cat.Tables.Refresh
cat.Groups(strGroupToProhibit).SetPermissions Null, _
adPermObjTable, adAccessDeny, adRightCreate
NoTables_Exit:
Set cat = Nothing
Exit Sub
NoTables_Err:
MsgBox "Error # " & Err.Number & ": " & Err.Description
Resume NoTables_Exit
End Sub

The code uses the SetPermissions method of the Groups collection of the Catalog object to set permissions for new tables. The parameters used in the example deny table creation rights for the group specified in the call to the function.


/ 544