Daren,

Hopefully this will help a little: I've put together a sample of using ADOMD
from the .NET Framework, and posted it to GotDotNet. Unfortunately it's in
C#, not VB.NET, but the concepts are identical and I don't think you'll have
any significant challenges converting specific concepts across to VB.NET.

The sample can be found here:

[url]http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=E8D0D8CA-9DE3-4E9F-8D26-EAB74F826F00[/url]

Good luck with your ysis Services developments!

Tim

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Daren" <darenrighthandmanager.com> wrote in message
news:eut6f3B2CHA.1656TK2MSFTNGP09...
> Thank you VERY much Sean. I appreciate your help. That seems to have
> worked. I'll post again if any issues arise with it.
>
> What about a place to see some good code examples of ADOMD and VB.NET. I
> know that MS is relying on the old samples that worked in VB 6, but the
> interop layer does add some idiosyncrasies to the code and it would be
nice
> to see code samples that are known to definitely work in VB.NET. At least
> until ADOMD is available as managed code, which according to what I have
> heard doesn't sound like it will happen until the end of this year, at the
> earliest. Since, BI is such a huge and growing industry segment that MS
has
> been trying to get a substantial foothold in, I find it to be odd that
> integrated support for AS will not be available until nearly 2 years after
> the release of VS.NET. I know that priorities need to be set for what is
> converted and what is done later, but was graphics programming more
> important than support for AS? Anyway, I am not here to whine. If you
> would like to pass my comments up the chain, feel free. What I am really
> looking for is some good code samples. Any ideas?
>
> Again, thanks for paying attention to the issue I was having and solving
it
> for me.
>
> Daren Bieniek, MCDBA, MCSE(4.0 & 2000)
>
>
> "Sean Boon [MS]" <seanboononline.microsoft.com> wrote in message
> news:u1u8LJ41CHA.1424TK2MSFTNGP12...
> > Hi Daren,
> >
> > I was ablo to repo your problem against Foodmart, but I did find a
> > workaround and I hope this works for you as well. Here's the code that
I
> > got to work. Basically, instead of using the .source property, use the
> > .open method and pass the MDX string in there.
> >
> >
> > Dim cnAS As New ADODB.Connection()
> >
> > Dim csDimMem As New ADOMD.Cellset()
> >
> > Dim strMDX As String
> >
> > cnAS.Open("PRovider=MSOLAP;Data Source=localhost;Initial
Catalog=Foodmart
> > 2000;")
> >
> > csDimMem.ActiveConnection = cnAS
> >
> > strMDX = "SELECT {[Measures].[Unit Sales]} on COLUMNS,
Time.month.members
> on
> > rows FROM SALES"
> >
> > csDimMem.Open(strMDX, cnAS)
> >
> >
> >
> >
> > --
> > Sean Boon
> > SQL BI Product Unit
> >
> > **This posting is provided AS IS, with no warranties, and confers no
> > rights.**
> >
> > "Daren" <darenrighthandmanager.com> wrote in message
> > news:OwH0Div1CHA.2488TK2MSFTNGP12...
> > > Thanks for realizing that VB.NET has some idiosyncrasies, but the
> problem
> > > you are talking about, I believe, has nothing to do with the issue
that
> I
> > am
> > > having. The error that I am receiving pops-up before I even get to
open
> > the
> > > query that returns the cellset. The error occurs when I set the
..source
> > > property. I will include a cope of my code again, so that people
don't
> > have
> > > to scroll so far down the message.
> > >
> > > Dim cnAS As New ADODB.Connection()
> > > Dim csDimMem As New ADOMD.Cellset()
> > > cnAS.Open("PRovider=MSOLAP;Data Source=localhost;Initial
> > > Catalog=CubeTest_2003_01_15;")
> > > csDimMem.ActiveConnection = cnAS
> > > strMDX = "WITH MEMBER Measures.[MemberKey] AS
> > > 'cstr([buyer].CurrentMember.Properties(""key""))'" & vbCrLf _
> > > & vbCrLf & "SELECT {[Measures].[MemberKey]} ON 0," &
> > vbCrLf
> > > _
> > > & " Descendants(buyer.&[1],100,LEAVES) ON 1
> "
> > &
> > > vbCrLf _
> > > & " FROM baseysiscube"
> > > csDimMem.Source = strMDX
> > >
> > > Again, as a secondary topic, where can I find good examples of using
> ADOMD
> > > with VB.NET. Again, that is VB.NET, NOT VB 6, the code is different.
> Any
> > > help would be greatly appreciated.
> > >
> > >
> > >
> > > "Akshai Mirchandani [MS]" <akshaimonline.microsoft.com> wrote in
> message
> > > news:esH2Wcs1CHA.2400TK2MSFTNGP11.phx.gbl...
> > > > Wayne, the problem is that the .NET languages appear to have some
> > problems
> > > > with the array reference parameter. I posted this sometime ago for
C#
> > and
> > > I
> > > > expect this applies in a similar fashion to VB.NET:
> > > >
> > > > Accessing cells in an ADOMD cellset in C# turns out to have a
slightly
> > > > strange syntax when doing interop. For example,
> > > >
> > > > object[] pos = new object[1];
> > > > pos[0] = System.Convert.ToInt16(cellOrdinal); //
> > > cellOrdinal
> > > > is the ordinal of the cell in the cellset
> > > >
> > > > ADOMD.Cell cell = cstResult.get_Item(ref pos); //
> cstResult
> > > is
> > > > the ADOMD cellset object
> > > >
> > > > The get_Item method requires an array of objects -- you can either
> pass
> > in
> > > a
> > > > single element containing the cell ordinal of the required cell, or
> you
> > > can
> > > > pass an array of axis positions with the coordinate of the cell.
> > > >
> > > > HTH,
> > > > Akshai
> > > >
> > > > "Wayne Snyder" <wsnyderikon.com> wrote in message
> > > > news:OjyVhCr1CHA.1928TK2MSFTNGP10...
> > > > > Search for ADOMD in SQL Books on line...
> > > > >
> > > > > Example follows.
> > > > >
> > > > > Dim conn As New ADODB.Connection
> > > > > Dim cst As New ADOMD.Cellset
> > > > > Dim axs As ADOMD.Axis
> > > > > Dim pos As ADOMD.Position
> > > > > Dim iCol As Integer, cCol As Integer
> > > > > Dim iRow As Integer, cRow As Integer
> > > > > Dim nFixedCols As Integer, nFixedRows As Integer
> > > > >
> > > > > 'Set up the connection to the server.
> > > > > conn.ConnectionString = "Datasource=LocalHost;
Provider=msolap;
> > > > Initial
> > > > > Catalog=FoodMart 2000;"
> > > > > conn.Open
> > > > > Set cst.ActiveConnection = conn ' You must use Set.
> > > > > cst.Source = "Select CrossJoin([Product].[Product
> Family].Members,
> > "
> > > &
> > > > _
> > > > > "[Promotion Media].Members) on rows," & _
> > > > > "[Measures].Members on Columns " & _
> > > > > "From Sales"
> > > > > cst.Open
> > > > >
> > > > > 'Set up the FlexGrid control.
> > > > > MSFlexGrid1.Clear
> > > > > nFixedCols = 2
> > > > > nFixedRows = 1
> > > > > cCol = cst.Axes(0).Positions.Count
> > > > > MSFlexGrid1.Cols = cCol + nFixedCols
> > > > > cRow = cst.Axes(1).Positions.Count
> > > > > MSFlexGrid1.Rows = cRow + nFixedRows
> > > > > MSFlexGrid1.FixedCols = nFixedCols
> > > > > MSFlexGrid1.FixedRows = nFixedRows
> > > > > MSFlexGrid1.MergeCol(0) = True
> > > > > MSFlexGrid1.MergeCol(1) = True
> > > > >
> > > > > 'Add column headers.
> > > > > iCol = 2
> > > > > For Each pos In cst.Axes(0).Positions
> > > > > 'The caption for each member is used as the header.
> > > > > MSFlexGrid1.TextMatrix(0, iCol) = pos.Members(0).Caption
> > > > > iCol = iCol + 1
> > > > > Next
> > > > >
> > > > > 'Add row headers.
> > > > > iRow = 1
> > > > > For Each pos In cst.Axes(1).Positions
> > > > > 'The CrossJoin function in MDX indicates that this axis
will
> > > have
> > > > > two members per position.
> > > > > MSFlexGrid1.TextMatrix(iRow, 0) = pos.Members(0).Caption
> > > > > MSFlexGrid1.TextMatrix(iRow, 1) = pos.Members(1).Caption
> > > > > iRow = iRow + 1
> > > > > Next
> > > > >
> > > > > 'Iterate through the cellset array values.
> > > > > For iCol = 0 To cCol - 1
> > > > > For iRow = 0 To cRow - 1
> > > > > ' Retrieve each value with the default method of the
cst
> > > > object.
> > > > > MSFlexGrid1.TextMatrix(iRow + nFixedRows, iCol +
> > nFixedCols)
> > > =
> > > > > cst(iCol, iRow).Value
> > > > > Next
> > > > > Next
> > > > >
> > > > >
> > > > > --
> > > > > Wayne Snyder MCDBA, SQL Server MVP
> > > > > Computer Education Services Corp (CESC), Charlotte, NC
> > > > > (Please respond only to the newsgroups.)
> > > > >
> > > > > PASS - the definitive, global community
> > > > > for SQL Server professionals - [url]http://www.sqlpass.org[/url]
> > > > >
> > > > > "Daren" <darenrighthandmanager.com> wrote in message
> > > > > news:OBWpFJq1CHA.2696TK2MSFTNGP09...
> > > > > > My specific question is around some code that doesn't seem to
wan
> to
> > > > work,
> > > > > > which I will show below. A broader question is, "Where can I
find
> > > some
> > > > > good
> > > > > > code samples for using ADOMD with VB.NET?"
> > > > > >
> > > > > > When I try to set the cellset.Source I get an error that says
> > invalid
> > > > > > parameter, which gives me little to go on.
> > > > > >
> > > > > > Anyway, here is the code snippet that I am having problems with.
> > > > > >
> > > > > > Dim cnAS As New ADODB.Connection() ' I declared it this
> > way,
> > > > > > becasue I couldn't find ADOMD.Connection
> > > > > > Dim csDimMem As New ADOMD.Cellset()
> > > > > >
> > > > > > cnAS.Open("PRovider=MSOLAP;Data Source=localhost;Initial
> > > > > > Catalog=CubeTest_2003_01_15;")
> > > > > > csDimMem.ActiveConnection = cnAS
> > > > > > strMDX = "WITH MEMBER Measures.[MemberKey] AS
> > > > > > 'cstr([buyer].CurrentMember.Properties(""key""))'" & vbCrLf _
> > > > > > & vbCrLf & "SELECT {[Measures].[MemberKey]} ON
0,"
> &
> > > > > vbCrLf
> > > > > > _
> > > > > > & "
Descendants(buyer.&[1],100,LEAVES)
> ON
> > 1
> > > > "
> > > > > &
> > > > > > vbCrLf _
> > > > > > & " FROM baseysiscube"
> > > > > > csDimMem.Source = strMDX
> > > > > >
> > > > > > I know the MDX is correct, besides, if it weren't correct it
would
> > > throw
> > > > > an
> > > > > > error at the .Open, not the .Source.
> > > > > >
> > > > > > Any help or advice would be greatly appreciated. Also, I am
sorry
> > if
> > > > this
> > > > > > was answered in these groups before. I did search for it and
> didn't
> > > > find
> > > > > > it.
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>