Using UDF to set Dimension Security -
10-10-2003
, 06:50 AM
Hi,
I receive various errors when I want to use a User Defined Function to
generate a memberset out of a database. This memberset is used in the
"Allowed Members"-window from the Custom Dimension Security-dialog.
Even if I hardcode a valid memberset as return value of the UDF then I
receive an error when saving the role.
The class I use for my UDF looks like:
----------------------------------------------------------------------------
--
[Visual Basic 6]
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "OLAPSecClass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'Main class
'Provides functions to be called by Analysis Services Dynamic Roles
Option Explicit
Public Function QryMembers(strSet As String) As String
Dim strMemberList As String
strMemberList = "{[Customers].[Name].&[81], [Customers].[Name].&[118]}"
QryMembers = strMemberList
End Function
----------------------------------------------------------------------------
--
The MDX-query in the Custom Dimension Security-dialog for the
Customers-dimension is: StrToSet(QryMembers("test"))
I am using Analysis Services Service Pack 3 and I am using the
Customers-dimension from the Foodmart-database
Thanks in advance,
Regards,
Paul |