Has anyone ever used cf to connect to an olap cube using mdx?  I found this
sample on the allaire message boards and it connects to our cube but will
not return any data.  Any suggestions would be greatly appreciated.  This
queries the sample cube that comes with OLAP services.

Eddie

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>
        <title>Cube Test</title>
</head>
<body>
<cfset adOpenStatic = 3>
<cfset adLockReadOnly = 1>
<cfset adCmdText = 1>
<!--- Grab the component--->

<cfobject type="COM"
                  name="cst"
                  class="ADOMD.Cellset"
                  action="CREATE">

 <!---This is where I now write the mdx expression--->
<cfset sMDX="SELECT TopCount({[Product].[Product Name].Members}, 1,
Measures.[Unit Sales]) ON COLUMNS FROM [Sales]">
<!---<cfset sMDX="SELECT ({[Measures].[MeasuresLevel].Members}) ON COLUMNS
FROM [The Cube]"> --->

<cfset cst = cst.open(sMDX,
"Provider=MSOLAP;Datasource=NHCNTMSSQL2000;Catalog=FoodMart;")>



<!---I have just added this to make sure that the variable is not empty.  If
it is the page will stop--->
<cfif "CST" IS  " ">
The variable is  empty.
<cfabort showerror="The Template was aborted because the variable is an
empty string">
</cfif>

<!---The values should be listed here--->
<cfform name="mdx">
<font face="arial" size=4>
Results:<br><br><br>
</font>
<font face="arial" size="3">
<cfoutput>
#cst#<br>
</cfoutput></font>

<font face="arial" size=4>
Your mdx query is:<br></font><br>
<font face="arial" size="3">
<cfoutput>
#smdx#
</cfoutput></font>
</cfform>

</body>

</html>



------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to