共用方式為


GrantPublicationAccess Method

未來的 Microsoft SQL Server 版本將移除這項功能。請避免在新的開發工作中使用這項功能,並規劃修改目前使用這項功能的應用程式。

The GrantPublicationAccess method adds the specified login to the publication access list.

語法

object.GrantPublicationAccess(szLoginName)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.

  • szLoginName
    String that identifies an existing Microsoft SQL Server login by name.

Prototype (C/C++)

HRESULT GrantPublicationAccess(SQLDMO_LPCSTR szLoginName);

備註

Granting privilege to a login using the GrantPublicationAccess method of the MergePublication or TransPublication object requires appropriate privilege. The SQL Server login used for SQLServer object connection must be a member of the system-defined role db_ownerin the published database, or a role with greater privilege.