ADO MD (OLAP) - CubeDefs - how to get cube data and properties?
Posted on 2004-11-02
Ive installed MDAC components to gain access to olap cubes(with D6). Im using the following code to do that:
procedure TForm1.CubeList(DataSource: WideString);
var I : Integer;
DS : WideString;
Catalog1 : ICatalog;
CubeDef1 : CubeDef;
Catalog1:=CreateComObject(StringToGUID('ADOMD.Catalog')) as ICatalog;
if Catalog1.CubeDefs.Count > 0 then
for i := 0 to Catalog1.CubeDefs.Count-1 do
CubeDef1:= Catalog1.CubeDefs[i] as CubeDef; // it fails here
Ive searched the google up and down and couldnt find a solution to this problem. I keep getting following error: [Error] Unit1.pas(57): Class does not have a default property. So my question is how to access cubes propeties and data? With code plz.
btw: Funny thing is that Catalog1.CubeDefs.Count returns the right number of cubes.