Hi chaps,
I am trying to create a local cube ,populating data from an oracle database.
I have checked the connection part of the string.. Its working fine.
The problem is -- it throws an error msg-- Fact Table not found...
Dim strCreateCube As String
Dim sSourceDSN As String
Dim sInsertInto As String
Dim adocon As New ADODB.Connection
Dim sLocation As String
sLocation = "LOCATION=C:\CubeOracle.cub"
strCreateCube = ""
strCreateCube = strCreateCube & "CREATECUBE= CREATE CUBE MYCUB " & vbCrLf
strCreateCube = strCreateCube & " (" & vbCrLf
strCreateCube = strCreateCube & " DIMENSION Product," & vbCrLf
strCreateCube = strCreateCube & " LEVEL [Product Family]" & vbCrLf
strCreateCube = strCreateCube & ")"
sInsertInto = ""
sInsertInto = sInsertInto & "INSERTINTO=INSERT INTO MYCUB" & vbCrLf
sInsertInto = sInsertInto & " (" & vbCrLf
sInsertInto = sInsertInto & " Product.[Product Family]" & vbCrLf
sInsertInto = sInsertInto & " )" & vbCrLf
sInsertInto = sInsertInto & " SELECT " & vbCrLf
sInsertInto = sInsertInto & " sales_fact_1997.[Product:Product Family]" & vbCrLf
sInsertInto = sInsertInto & " FROM sales_fact_1997" & vbCrLf
sInsertInto = sInsertInto & " WHERE sales_fact_1997.[Time:year]='1997'"
stSourceDSN = """Provider=MSOLAP;" & _
"Data Source=qspl_quantlink;" & _
"User ID=scott;" & _
"Password=tiger"""
sSourceDSN = "SOURCE_DSN=" & stSourceDSN
strConnection = sLocation & ";" & vbCrLf & sSourceDSN & ";" & vbCrLf & strCreateCube & ";" & vbCrLf & sInsertInto
MsgBox strConnection
Set cn = New ADODB.Connection
cn.Provider = "MSOLAP"
cn.Open strConnection
MsgBox "Cube created!"
adocon.Close
ProcExit:
Exit Sub
ProcErr:
MsgBox Err.Number & Err.Description & Err.Source
I have also replaced the string provider=OraOLEDB.Oracle & MSDAORA.1 instead of olap but it still gives the same error....
Could u pls tell me what is the problem.. Do I need to create a fact table physically in the oracle database and realate it to the other dimension tables or what else do I need to check.
Thnx
Loydon