Christer,
Here is how we do it. Note that this is a J++ example, but you should be
able to get the jist of it. The context is based on Foodmart, and the
returned rowset will be empty because there are no cell actions at that
context, but you should get the idea.
//create noparam variant
Variant noParam = new Variant();
noParam.noParam();
Variant empty = new Variant();
empty.putNull();
com.ms.com.SafeArray safea = new
com.ms.com.SafeArray(Variant.VariantVariant, 7);
// here you create a array of restrictions just like many other schema
rowset calls
safea.setVariant(2, new Variant("Sales")); // Cube name
safea.setVariant(4, new Variant(0x0));
safea.setVariant(5, new Variant("[Customers].[All Customers]")); //
Context tuple
safea.setVariant(6, new Variant(MDACTION_COORDINATE_CELL));
Variant restrictions = new Variant(safea, true);
//run the query.
Recordset actions = getADOConn().OpenSchema(
msado15.SchemaEnum.adSchemaProviderSpecific,
restrictions,
new
com.ms.com.Variant("{a07ccd08-8148-11d0-87bb-00c04fc33942}"));
Ok, so a word about the last parameter. Back in the day (about 4 years ago)
when we were adding actions support to our client app, there wasn't a
defined rowset value that we could find for actions, so we weasled the GUID
for them out of some AS2000 guys we knew and used that. Worked then, works
now. Might be a more "official" way now (hopefully) but I've never bothered
to look into it. Ain't broke. don't fix, etc.
Hope this helps point you in the right direction!
Keith
"Christer K" <a@b.com> wrote
Quote:
I have tried using the OpenSchema it works fine to get action defined for
member but how to get defined actions for cells?
Set oRs = oCon.OpenSchema(adSchemaActions, _
Array("", "", mstrCube, "", MDACTION_TYPE_URL, ??, _
MDACTION_COORDINATE_CELL))
What parameters should be used for the OpenSchema function?
/Christer |