G
Guest
I have a SQL Server 2000 with a SQL server database and an OLAP cube in Analysis server, both on the same machine. I need to access both the OLAP qube and the SQL database from my Access forms. The MDX query for the OLAP Cube is quite simple, but I cannot make it work. I have tried to use principles described in:
Retrieve an ADOMD Cellset as an ADODB Recordset
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q21336
Please find my code below. The client VBA code displays the number of records (the cube cells are successfully loaded into the adodb.recordset from the olap cube), but my form refuse to accept adoRS (ADODB.Recordset) as its source recordset. I get the following error: The Object you entered is not a valid recordset property
The comments indicate where the error occurs. Any help will be appreciated. Here is the code that fails
'----------------------------------------------------------------------------------------------------------
Option Compare Databas
Option Explici
Private Sub Form_Open(Cancel As Integer
Const strConnect = "Data Source=dfjdt50j;PROVIDER=MSOLAP;INITIAL CATALOG=TeleMarketing
On Error GoTo ErrorHandle
Dim objAdoData As New ADOBusOb
Dim adoRS As New ADODB.Recordse
With objAdoDat
.SQL = "Select "
& " non empty{[TMD_Products].[All TMD_Products].[Datatjenester].[Bedriftsnett] }on columns, "
& " non empty{[TMD_KIDs].[Kid].members} on rows "
& " from TMC_Products "
& " where [Measures].[AntallAb]
.ADOConnect strConnect, 20 'Establish connection
End Wit
'adoRS.CursorLocation = adUseClien
'adoRS.CursorType = adOpenStati
Set adoRS = objAdoData.GetR
MsgBox adoRS.RecordCount 'Works perfectly, displays number of record
Set Me.Recordset = adoRS '!!!!!Get error: The object you entered is not a valid recordset propert
Exit Su
ErrorHandler
MsgBox "Change Failed:" & vbCrLf & Err.Number & vbCrLf & Err.Description, vbOKOnly, "Data Object
Exit Su
End Su
'-------------------------------------------------------------------------------------------------------------------------
Regard
Tor
Retrieve an ADOMD Cellset as an ADODB Recordset
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q21336
Please find my code below. The client VBA code displays the number of records (the cube cells are successfully loaded into the adodb.recordset from the olap cube), but my form refuse to accept adoRS (ADODB.Recordset) as its source recordset. I get the following error: The Object you entered is not a valid recordset property
The comments indicate where the error occurs. Any help will be appreciated. Here is the code that fails
'----------------------------------------------------------------------------------------------------------
Option Compare Databas
Option Explici
Private Sub Form_Open(Cancel As Integer
Const strConnect = "Data Source=dfjdt50j;PROVIDER=MSOLAP;INITIAL CATALOG=TeleMarketing
On Error GoTo ErrorHandle
Dim objAdoData As New ADOBusOb
Dim adoRS As New ADODB.Recordse
With objAdoDat
.SQL = "Select "
& " non empty{[TMD_Products].[All TMD_Products].[Datatjenester].[Bedriftsnett] }on columns, "
& " non empty{[TMD_KIDs].[Kid].members} on rows "
& " from TMC_Products "
& " where [Measures].[AntallAb]
.ADOConnect strConnect, 20 'Establish connection
End Wit
'adoRS.CursorLocation = adUseClien
'adoRS.CursorType = adOpenStati
Set adoRS = objAdoData.GetR
MsgBox adoRS.RecordCount 'Works perfectly, displays number of record
Set Me.Recordset = adoRS '!!!!!Get error: The object you entered is not a valid recordset propert
Exit Su
ErrorHandler
MsgBox "Change Failed:" & vbCrLf & Err.Number & vbCrLf & Err.Description, vbOKOnly, "Data Object
Exit Su
End Su
'-------------------------------------------------------------------------------------------------------------------------
Regard
Tor