Database
  Home arrow Database arrow Page 4 - Exploring OLAP Cube with Visual Basic
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE

Exploring OLAP Cube with Visual Basic
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 21
    2005-08-18

    Table of Contents:
  • Exploring OLAP Cube with Visual Basic
  • Measures and Dimensions: Cube details under investigation
  • Using VB to Explore the OLAP Cube: Creating a VB Project
  • Properties of the Cube: Properties of Dimensions
  • Properties of Hierarchies
  • Properties of Levels

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Exploring OLAP Cube with Visual Basic - Properties of the Cube: Properties of Dimensions


    (Page 4 of 6 )

    A cube is constructed from dimensions and measures, as mentioned earlier. Cubes store data derived from relational data and contain categorized data useful in analysis. These categories are the dimensions, and should be distinct. If the data type in the dimension is of type time, it is called a Time dimension; otherwise, it is a Standard dimension.

    The following code will bring out all the properties of the dimensions. Notice that the connection is of the type ADODB. The connection string is simple, containing the provider, the SQL Server data, and the Initial Catalog. The ocube is the cube object described in the catalog. This code counts the number of dimensions (4); lists the various dimensions (Measures, MyOrders, MyProducts, MyCustomers, MyOrders); and lists the various properties (17) of the Measures.

    Private Sub Command1_Click()
    'Open a connection by providing a 
    'connection string
    oCn.Open "Provider=MSOLAP;Data Source=NECHOST; & _
    Initial Catalog=NewOlap;"
    'Catalog's active connection is established
    Set oCat.ActiveConnection = oCn
    'Cube is defined by catalog's CubeDef()method
    Set ocube = oCat.CubeDefs(0)
    'Cube's dimension is defined
    Set ocdim = oCat.CubeDefs(0).Dimensions(0)
    'number of dimensions in the cube counted
    Debug.Print ocube.Dimensions.Count
    Dim ccnt As Integer
    ccnt = ocube.Dimensions.Count
    Dim j
    For j = 0 To ccnt - 1
    Debug.Print "------"
    'name of dimension printed
    Debug.Print ocube.Dimensions(j).Name
    Next j
    'dimensions properties are counted
    Debug.Print ocdim.Properties.Count
    Dim cnt
    cnt = ocdim.Properties.Count
    Dim i
    For i = 0 To cnt - 1
    'Dimenion's Name, Type, and value are printed
    Debug.Print ocdim.Properties(i).Name & "," & _
    ocdim.Properties(i).Type & "," & _
    ocdim.Properties(i).Value
    Next
    End Sub
    

    The above code accesses the properties of the shared dimensions of the cube, as shown in this picture.

    The result of running the above procedure produces the following the properties of the Measures. A similar result is obtained for the other dimensions as well.

     4 
    ------
    Measures same as, MyOrderDetails in the above picture
    ------
    MyCustomers
    ------
    MyOrders
    ------
    MyProducts
    17 
    CATALOG_NAME,202,NewOlap
    SCHEMA_NAME,202,
    CUBE_NAME,202,MyFirstCube
    DIMENSION_NAME,202,Measures
    DIMENSION_UNIQUE_NAME,202,[Measures]
    DIMENSION_GUID,72,
    DIMENSION_CAPTION,202,Measures
    DIMENSION_ORDINAL,19,0
    DIMENSION_TYPE,2,2
    DIMENSION_CARDINALITY,19,3
    DEFAULT_HIERARCHY,202,[Measures]
    DESCRIPTION,202,
    IS_VIRTUAL,11,False
    IS_READWRITE,11,False
    DIMENSION_UNIQUE_SETTINGS,3,0
    DIMENSION_MASTER_UNIQUE_NAME,202,
    DIMENSION_IS_VISIBLE,11,True
    

    More Database Articles
    More By Jayaram Krishnaswamy


       · You are welcome to comment. Hierearchy is a big deal in OLAP. There are two aspects...
       · You article about Olap (cubes) with VB (6.0) was very interesting. I'm thinking if...
       · Right now I do not have one, but I have been planning on writing a sequel. However,...
       · Is there a way in .NET to programmatically create a new dimension for an existing...
     

    DATABASE ARTICLES

    - Excel Reference
    - Database Programming in C# with MySQL : Usin...
    - Formatting Techniques for Data Access from E...
    - Data Access from Excel VBA
    - Generating a Multiple Table Crystal Report u...
    - ADO and the Command Object
    - On Wiring Up an ADO Data Control
    - Reading and Writing to Files on the Intranet
    - Using ADO Record to Create and Navigate Intr...
    - Using Data Access Pages to Access Data on a ...
    - Using ADO with the SQL Native Client
    - ADO`s Stream Object
    - Opening a Record Object Referencing an Open ...
    - Introducing Jasper (SQL Anywhere 10 Beta)
    - Creating a Database Project in VS 2005

     
    Application Delivery: Everything You Wanted to Know, but Didn`t Know You Needed to Ask
    A comprehensive guide to examining the topics of Wide-area Data Services and app....

     
    Best Practices: Safe and Secure Hardware Asset Recovery
    Companies increasingly must meet EPA and local requirements for the disposal of ....

     
    Managing SSL Security in Multi-Server Environments
    Read this white paper to learn how to simplify management of your organization's....

     
    Open Source Security Myths
    Open Source Software (OSS) is computer software whose source code is available t....

     
    Power and Cooling Capacity Management for Data Centers
    This paper describes the principles for achieving power and cooling capacity man....

     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT