🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #4096

ADOMD: How can retrieve MEMBERS PROPERTY using ICellset class?

#4096
From: Sorokoletov Gregory
Date: Thu, 11 Apr 2002 16:43
113 lines
2867 bytes
Hi,



I wrote simple MDX query:

select {[Measures].[Store Cost],[Measures].[Store Sales]} on columns,

            NON EMPTY [Customers].[Name].Members

               DIMENSION PROPERTIES Customers.Gender, Customers.Education
on rows

from Sales

where ([Time].[1997])



As you can see It returns 2 properties: Customers.Gender,
Customers.Education



The question is: How can I retrieve that 2 properties using TCOMICellset
class(from ADOMD)?









I tried to use the following:

:

CellSet1->Open(dxMemo1->Text);  // Execute MDX query

:

// processing fields definition

Adodb_tlb::Properties *Prs;

Property *Pr1;

Prs=
CellSet1->Axes->get_Item(1)->Positions->get_Item(2)->Members->get_Item(0)->P
roperties;

Pr1=
CellSet1->Axes->get_Item(1)->Positions->get_Item(2)->Members->get_Item(0)->P
roperties->get_Item(0);

Pr1=
CellSet1->Axes->get_Item(1)->Positions->get_Item(2)->Members->get_Item(0)->P
roperties->get_Item(1);



// Next line will generate error (access violation)

int PropsCount= Prs->Count;   //   WHY
????????????????????????????????????????

// Next line also will generate error (access violation)

int PropValue= Pr1->get_Value(); //   WHY
????????????????????????????????????????



:



  for(I= 1; I <= CellSet1->Axes->get_Item(0)->Positions->Count; I++)

  {

    AnsiString ColName;

    pNewDef= ClientDataSet1->FieldDefs->AddFieldDef();



    ColName= CellSet1->Axes->get_Item(0)->Positions->get_Item(I-
1)->Members->get_Item(0)->Caption;

    ColName+= " ("+
IntToStr(CellSet1->Axes->get_Item(0)->Positions->get_Item(I- 1)->Ordinal)
+")";

    pNewDef->Name= ColName;

    pNewDef->DataType= ftFloat;

  }



but it dos not work, Help please!





Thanks,

Gregory
Technical Details
Message-ID: <3cb5bd44$1_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!usenetserver.com!hub1.nntpserver.com!telocity-west!TELOCITY!news-out.spamkiller.net!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,699ad39162d2b5f9,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-04-11 09:59:23 PST
From: "Sorokoletov Gregory" <gsorokoletov@sovintel.net>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: ADOMD: How can retrieve MEMBERS PROPERTY using ICellset class?
Date: Thu, 11 Apr 2002 20:43:49 +0400
Lines: 118
Organization: Sovintel
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 212.44.130.15
Message-ID: <3cb5bd44$1_1@dnews>
X-Trace: dnews 1018543428 212.44.130.15 (11 Apr 2002 09:43:48 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!usenetserver.com!hub1.nntpserver.com!telocity-west!TELOCITY!news-out.spamkiller.net!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews