The Logins collection contains Login objects referencing login records that form one part of Microsoft® SQL Server™ security.
With the Logins collection, you can:
For more information about creating SQL Server login records by using the Login object and Logins collection, see Login Object.
To remove a login record
oSQLServer.Logins.Remove("anned")
When using the Item or Remove method, the Logins collection supports member identification using either name or ordinal reference syntax. For example:
Set oLogin = oSQLServer.Logins("stevenb")
Or:
Set oLogin = oSQLServer.Logins(1)
Note Creating or removing SQL Server logins by using the Logins collection requires appropriate privilege. The SQL Server login used for SQLServer object connection must be a member of the fixed role securityadmin or a role with greater privilege.
Add Method | Refresh Method |
Item Method | Remove Method (Collections) |