Y
yousoft
Unregistered / Unconfirmed
GUEST, unregistred user!
Dim cn As ADODB.Connection
Dim ct As ADOMD.Catalog
Dim cb As ADOMD.CubeDef
Dim dm As ADOMD.Dimension
Dim hr As ADOMD.Hierarchy
Dim lv As ADOMD.Level
Dim mb As ADOMD.Member
Dim pr As ADODB.Property
Set cn = New ADODB.Connection
cn.Open "provider=msolap;data source=c:/warecube.cub"
Set ct = New ADOMD.Catalog
Set ct.ActiveConnection = cn
Set cb = ct.CubeDefs(0)
Set dm = cb.Dimensions("Product")
Set hr = dm.Hierarchies(0)
Set lv = hr.Levels("Product Name")
For Each mb In lv.Members
Debug.Print mb.Name
Debug.Print "----------------"
For Each pr In mb.Properties
Debug.Print pr.Name & ": " & pr.Value
Next pr
Debug.Print
Next mb
其中ADOMD.CubeDef、ADOMD.Dimension ADOMD.Hierarchy ADOMD.Level、ADOMD.Member
在我引入ADOMD后都不能用,在VB中可以。怎么回事??
Dim ct As ADOMD.Catalog
Dim cb As ADOMD.CubeDef
Dim dm As ADOMD.Dimension
Dim hr As ADOMD.Hierarchy
Dim lv As ADOMD.Level
Dim mb As ADOMD.Member
Dim pr As ADODB.Property
Set cn = New ADODB.Connection
cn.Open "provider=msolap;data source=c:/warecube.cub"
Set ct = New ADOMD.Catalog
Set ct.ActiveConnection = cn
Set cb = ct.CubeDefs(0)
Set dm = cb.Dimensions("Product")
Set hr = dm.Hierarchies(0)
Set lv = hr.Levels("Product Name")
For Each mb In lv.Members
Debug.Print mb.Name
Debug.Print "----------------"
For Each pr In mb.Properties
Debug.Print pr.Name & ": " & pr.Value
Next pr
Debug.Print
Next mb
其中ADOMD.CubeDef、ADOMD.Dimension ADOMD.Hierarchy ADOMD.Level、ADOMD.Member
在我引入ADOMD后都不能用,在VB中可以。怎么回事??