共用方式為


Users Collection

未來的 Microsoft SQL Server 發行版本將不再提供此功能。請避免在新的開發工作中使用此功能,並計劃修改目前使用此功能的應用程式。

The Users collection contains User objects that reference Microsoft SQL Server database user definitions.

顯示目前物件的 SQL-DMO 物件模型

Properties

Count Property

Methods

Add Method

Refresh Method

Item Method

Remove Method (Collections)

ItemByID Method

 

備註

A SQL Server user forms one part of SQL Server security implementation. A user represents either a SQL Server login or Microsoft Windows security account with data access privilege within a SQL Server database.

With the Users collection, you can:

  • Create a SQL Server database user.
  • Remove a SQL Server database user.

For more information about creating and removing SQL Server database users by using the User object and Users collection, see User Object.

When using the Item or Remove method, the Users collection supports member identification using either name or ordinal reference syntax. For example:

Set oUser = oDatabase.Users("someone")

Or:

Set oUser = oDatabase.Users(2)
ms144399.note(zh-tw,SQL.90).gif附註:
Creating or removing SQL Server database users by using the Users collection requires appropriate privilege. The SQL Server login used for SQLServer object connection must be a member of the fixed role db_accessadmin or a role with greater privilege.