Virtual Cube and DSO

Virtual Cube and DSO

Post by Gianluca Maggi » Thu, 13 Jul 2000 04:00:00



Anyone of you knows how to create a Virtual Cube with DSO?

The following code fails to create one:
...
Set dsoCube = dsoDatabase.MDStores.AddNew("Test", sbclsVirtual)
dsoCube.MDStores.AddNew "Regular Cube1"
...
Where "Regular Cube 1" is regular cube in dsoDatabase

It fails returning a runtime error 91 - Object Variabile Or With Block Not
Set...

Instead, using the following code:
...
Set dsoCube = dsoDatabase.MDStores.AddNew("Test", sbclsVirtual)
dsocube.MDStores.Add dsodatabase.MDStores("Regular Cube1")
...
It fails returning a runtime error 80040001 - Collection Is Read Only.

So, is It possible to create a Virtual Cube With DSO????

Thanks All

 
 
 

Virtual Cube and DSO

Post by nl » Thu, 13 Jul 2000 04:00:00


No, what you are doing here is what sounds logical but what is not. I mean,
using MMC seems like a VCube is a collection of regular cubes but in the
hard reality, it is not.
You should create a cube specifying it's virtual and then
1) add the required measures
2) add the required dimensions
3) add the commands
4) the roles

and that's it.
so, to add a VCube:
    Set dstCube =db.MdStores.AddNew("Cube_X", sbclsVirtual)
to add the measures:
    Set pMeasure =dstCube.Measures.AddNew("Measure1")
    pMeasure.SourceColumn ="[" & SourceCubeName & "].[" & DesiredMeasureName
& "]"

the SourceCubeName.DesiredMeasureName indicates where is the data coming
from. Here is where you specify which cube will be composing the VCube.
This means "I'll be using ONE (DesiredMeasureName) measure from THAT
(SourceCubeName) cube".

after that, you can continue adding the dimensions and the calculated
members (commands) as usually.

HTH


Quote:> Anyone of you knows how to create a Virtual Cube with DSO?

> The following code fails to create one:
> ...
> Set dsoCube = dsoDatabase.MDStores.AddNew("Test", sbclsVirtual)
> dsoCube.MDStores.AddNew "Regular Cube1"
> ...
> Where "Regular Cube 1" is regular cube in dsoDatabase

> It fails returning a runtime error 91 - Object Variabile Or With Block Not
> Set...

> Instead, using the following code:
> ...
> Set dsoCube = dsoDatabase.MDStores.AddNew("Test", sbclsVirtual)
> dsocube.MDStores.Add dsodatabase.MDStores("Regular Cube1")
> ...
> It fails returning a runtime error 80040001 - Collection Is Read Only.

> So, is It possible to create a Virtual Cube With DSO????

> Thanks All


 
 
 

1. Error creating a virtual Cube with DSO

 I'm trying to create a virtual cube using the following
VBScript code and i receive the message

        Error "The LockType parameter is not valid
        Source DSO.LockManager

The error is generated at the line with the instruction

       dsoVirtualCube.Update

Nevertheless the virtual cube is created with a white Icon
and a red cross . But i can't delete it using the Analysis
Manager and when a tried to delete it using the code
written after the virtual-Cube creation code the same
error message is reported and the cube isn't deleted.

        virtual-Cube creation code

        strCubeName = "RegularCube"
        strDBName = "Comercial"
        sbclsVirtual = 8

        Set dsoServer = CreateObject("DSO.Server")
        dsoServer.Connect "DatosComercial"

        Set dsoDB = dsoServer.MDStores(strDBName)

        strVirtualCubeName = "VirtualCube"

        Set dsoVirtualCube = dsoDB.MDStores.AddNew
(strVirtualCubeName, sbclsVirtual)

        dsoVirtualCube.Description = "The TestDB virtual
cube"

       ' Set the source dimensions for the virtual cube by
        ' copying the dimensions from the underlying cube.
        For Each dsoDim In dsoDB.MDStores
(strCubeName).Dimensions
            dsoVirtualCube.Dimensions.AddNew dsoDim.Name
        Next

        Set dsoMea = dsoVirtualCube.Measures.AddNew("Exi")
        dsoMea.SourceColumn = "[" & strCubeName & "].[Exi]"

        dsoVirtualCube.Update

        dsoVirtualCube.Process
        MSGBOX "Virtual Cube created"

        virtual-Cube deletion code

        strDBName = "Comercial"
        strCubeName = "VirtualCube"

        Set dsoServer = CreateObject("DSO.Server")
        dsoServer.Connect "DatosComercial"

        Set dsoDB = dsoServer.MDStores(strDBName)
        dsoDB.MDStores.Remove strCubeName

        msgbox "virtual Cube deleted"

Many thanks in advance

2. not null constraint

3. Deploying virtual cubes using DSO

4. Select * slower than Select champ1, champ2, --Need other opinion--

5. Problem creating virtual cube with DSO

6. Error in FPW2.6a with IE 5

7. Adding calc measures to virtual cubes with dso

8. Help on SQL statement

9. Unable to create a virtual cube using DSO (Microsoft OLAP Service)

10. Unable to create a virtual cube using DSO

11. Adding existing roles to virtual cube using DSO

12. dso and virtual cubes

13. DSO Virtual Cube