后续版本的 Microsoft SQL Server 将删除该功能。请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。
The HasDBAccess property reports whether a user has explicit permissions to access a database.
语法
object
.HasDBAccess
Parts
- object
An expression that evaluates to an object in the Applies To list
Data Type
Boolean
Modifiable
Read-only
Prototype (C/C++)
HRESULT GetHasDBAccess (LPBOOL pRetVal);
备注
After a connection is established to Microsoft SQL Server, an application can use the HasDBAccess property to determine whether a user has explicit access to a particular database. If HasDBAccess returns FALSE, the user does not have access. Use the Grant, Deny, or Revoke methods to manipulate user database permissions.