Share via


clsMiningModelRole

[!참고]

  이 기능은 다음 버전의 Microsoft SQL Server에서 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 가능한 한 빨리 수정하십시오.

An object of the ClassType clsMiningModelRole provides a specific implementation of the Decision Support Objects (DSO) Role interface for data mining models. This object provides collections, methods, and properties through the Role interface.

You use objects of ClassType clsMiningModelRole to manage the set of users who can access a mining model and the manner in which they can access it. A mining model role has a name, a description, a parent object, a class type, a list of users, and a set of permissions. Each permission has a key and a corresponding permission expression.

You create roles at the database level (database roles) and then assign them to mining models (mining model roles) by adding them to the collection of roles associated with the mining model.

You can remove a database role by removing it from the database's collection of role objects. When you do so, the system automatically removes the corresponding mining model roles from the mining model's collection of role objects.

You can remove a mining model role by removing it from the mining model's collection of role objects. When you do so, the corresponding database role is not affected. However, the definition of the mining model role remains in effect until you update or process the cube.

Examples

If dsoDb.DataSources("DMTest") Is Nothing Then
    Set dsoDs = dsoDb.DataSources.AddNew("DMTest")
    dsoDs.ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source=d:dmtest2.mdb"
    dsoDs.Update
End If
'Create a new mining model role.
If dsoDb.Roles("DMDev") Is Nothing Then
    Set dsoRole = dsoDb.Roles.AddNew("DMDev")
    dsoRole.UsersList = "DOMAIN\SomeUser"
    dsoRole.Update
End If

'Check to see whether the mining model exists.
If Not dsoDb.MiningModels("CustSalesRel") Is Nothing Then
    'Delete it if it does.
    dsoDb.MiningModels.Remove "CustSalesRel"
End If
'Now create the model afresh.
Set dsoDmm = dsoDb.MiningModels.AddNew("CustSalesRel")
'Add a new datasource for the model
dsoDmm.DataSources.AddNew "DMTest"
'Add a data mining role to the new mining model.
Set dsoRole = dsoDmm.Roles.AddNew("DMDev")