dbTalk Databases Forums  

How do you control field names using ADO with MDX?

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss How do you control field names using ADO with MDX? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Robert Chapman
 
Posts: n/a

Default How do you control field names using ADO with MDX? - 02-19-2006 , 12:06 PM






Hi,

I'm using VBA to send MDX statements to a cube which is returning the
results I need except for the field names which comes back as shown below. I
need the field names to be Group, LineGroupAlt, and 200501, 200502, etc.
Having tried a number of dimension properties (Members WithDataCaption, etc)
with no success, I'ds appreciate if someone could let me know how this is
done.

[Line].[Group].[Group].[MEMBER_CAPTION] [Line].[LineGroupAlt].[LineGroupAlt].[MEMBER_CAPTION] [Time].[Month].&[200501] [Time].[Month].&[200502] [Time].[Month].&[200503] [Time].[Month].&[200504] [Time].[Month].&[200505] [Time].[Month].&[200506] [Time].[Month].&[200507] [Time].[Month].&[200508] [Time].[Month].&[200509] [Time].[Month].&[200510] [Time].[Month].&[200511] [Time].[Month].&[200512]

Many thanks,
Rob


Reply With Quote
  #2  
Old   
Elad
 
Posts: n/a

Default Re: How do you control field names using ADO with MDX? - 02-19-2006 , 12:13 PM






Use dimensions properties like so:

SELECT <Set_Expression> PROPERTIES MEMBER_CAPTION ON 0 FROM ...

"Robert Chapman" <RobertChapman (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,

I'm using VBA to send MDX statements to a cube which is returning the
results I need except for the field names which comes back as shown below.
I
need the field names to be Group, LineGroupAlt, and 200501, 200502, etc.
Having tried a number of dimension properties (Members WithDataCaption,
etc)
with no success, I'ds appreciate if someone could let me know how this is
done.

[Line].[Group].[Group].[MEMBER_CAPTION]
[Line].[LineGroupAlt].[LineGroupAlt].[MEMBER_CAPTION]
[Time].[Month].&[200501] [Time].[Month].&[200502] [Time].[Month].&[200503]
[Time].[Month].&[200504] [Time].[Month].&[200505] [Time].[Month].&[200506]
[Time].[Month].&[200507] [Time].[Month].&[200508] [Time].[Month].&[200509]
[Time].[Month].&[200510] [Time].[Month].&[200511] [Time].[Month].&[200512]

Many thanks,
Rob




Reply With Quote
  #3  
Old   
Robert Chapman
 
Posts: n/a

Default Re: How do you control field names using ADO with MDX? - 02-19-2006 , 01:06 PM



Hmm, been trying this out but how do I actually set the member caption? I
think mine must be blank? Ideally I'd like to have names that are set in the
dimension rather than in the MDX query so that the values automatically flow
through to the field names. Is this possible?

Thanks, Rob

"Elad" wrote:

Quote:
Use dimensions properties like so:

SELECT <Set_Expression> PROPERTIES MEMBER_CAPTION ON 0 FROM ...

"Robert Chapman" <RobertChapman (AT) discussions (DOT) microsoft.com> wrote in message
news:ABBF926C-597D-47F7-ADBA-BDBFED23EF62 (AT) microsoft (DOT) com...
Hi,

I'm using VBA to send MDX statements to a cube which is returning the
results I need except for the field names which comes back as shown below.
I
need the field names to be Group, LineGroupAlt, and 200501, 200502, etc.
Having tried a number of dimension properties (Members WithDataCaption,
etc)
with no success, I'ds appreciate if someone could let me know how this is
done.

[Line].[Group].[Group].[MEMBER_CAPTION]
[Line].[LineGroupAlt].[LineGroupAlt].[MEMBER_CAPTION]
[Time].[Month].&[200501] [Time].[Month].&[200502] [Time].[Month].&[200503]
[Time].[Month].&[200504] [Time].[Month].&[200505] [Time].[Month].&[200506]
[Time].[Month].&[200507] [Time].[Month].&[200508] [Time].[Month].&[200509]
[Time].[Month].&[200510] [Time].[Month].&[200511] [Time].[Month].&[200512]

Many thanks,
Rob





Reply With Quote
  #4  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: How do you control field names using ADO with MDX? - 02-22-2006 , 06:28 AM



Sounds like you are opening the results of the MDX query into a an ADO
recordset object. This will "flatten" the result set and return these
"strange" column names.

What you probably want to do is to use a cellset from the ADOMD library.
This is a slightly different way of working with the data, if you want
to see some an example the source for the MDX Sample app that comes with
AS 2000 is written in VB6 and works with cellset objects.

Tom Chester also has a little sample written in Excel VBA, that will run
MDX queries, which you might be interested in. You can find it at
http://www.tomchester.net/articlesdo...mdx_applet.xls

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <ABBF926C-597D-47F7-ADBA-BDBFED23EF62 (AT) microsoft (DOT) com>,
RobertChapman (AT) discussions (DOT) microsoft.com says...
Quote:
Hi,

I'm using VBA to send MDX statements to a cube which is returning the
results I need except for the field names which comes back as shown below. I
need the field names to be Group, LineGroupAlt, and 200501, 200502, etc.
Having tried a number of dimension properties (Members WithDataCaption, etc)
with no success, I'ds appreciate if someone could let me know how this is
done.

[Line].[Group].[Group].[MEMBER_CAPTION] [Line].[LineGroupAlt].[LineGroupAlt].[MEMBER_CAPTION] [Time].[Month].&[200501] [Time].[Month].&[200502] [Time].[Month].&[200503] [Time].[Month].&[200504] [Time].[Month].&[200505] [Time].[Month].&[200506] [Time].[Month].&[200507] [Time].[Month].&[200508] [Time].[Month].&[200509] [Time].[Month].&[200510] [Time].[Month].&[200511] [Time].[Month].&[200512]

Many thanks,
Rob




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.