Showing posts with label property. Show all posts
Showing posts with label property. Show all posts

Tuesday, March 6, 2012

ADOMD.net Can't get the KPI.ID or Cube.ID

When you open an AS project, you will see every object has an ID property, just like KPI.ID and cube.ID and Dimention.ID. And that's diffrent of the Name property. You could chanage the name property to everything you like, but when you created an object, you could not change it's ID.

When i use the ADOMD.NET, I could do this:

Dim myKPIConnection As AdomdConnection
Dim myCubeDef As CubeDef
Dim k As Kpi

myConnectionString = "Data Source=" + myOlapServer + ";Catalog=" + myOlapDatabase + ";Provider=MSOLAP;"

myKPIConnection = New AdomdConnection(myConnectionString)
myKPIConnection.Open()

For i = 0 To myKPIConnection.Cubes.Count - 1

If myKPIConnection.Cubes(i).Type = CubeType.Cube Then

myCubeDef = myKPIConnection.Cubes(i)

k = myKPIConnection.Cubes(i).Kpis(0)

MessageBox.Show(k.Name)

MessageBox.Show(k.Caption)

end if
next

But the question is, there's no k.ID or cubes(i).ID property there!

The k.Name and k.Caption both refer to the kpi's Name property in the AS server in factly.

Is that means we could not use the object 's ID property in the ADOMD.NET?

Another question, in MDX, we could only refer a dimention by it's name, and could not by it's ID, right?

ivanchain wrote:

Is that means we could not use the object 's ID property in the ADOMD.NET?

Another question, in MDX, we could only refer a dimention by it's name, and could not by it's ID, right?

That's right. In ADOMD.NET and MDX all references are done by name. The ID property is mainly used by the administrative APIs

ADOMD.net 9.0 (client) and CubeDef.LastProcessed

What is this property (CubeDef.LastProcessed) supposed to return as it does not return the date the cube was last processed?

Does AMO provide this info more reliably ?

TIA
Dave

Hi Dave,

It's a bug - CubeDef.LastProcessed returns the last time the server was restarted as far as I know. See
http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=124606

...for more details. Take a look at the comment posted by furmangg on April 28th on this entry on my blog for some code which does what you want:
http://cwebbbi.spaces.live.com/Blog/cns!7B84B0F2C239489A!675.entry

It's also available in the Analysis Services Stored Procedure Project here:
http://www.codeplex.com/Wiki/View.aspx?ProjectName=ASStoredProcedures&title=CubeInfo

HTH,

Chris

|||

Thanks Chris,

Its not resolved in SP1 either... Im going to check out AMO.

Cheers
Dave

|||FWIW AMO works for AS2005 when retrieving the last processed datetime. Doesnt work for AS2000 or local cubes.

ADOMD.net 9.0 (client) and CubeDef.LastProcessed

What is this property (CubeDef.LastProcessed) supposed to return as it does not return the date the cube was last processed?

Does AMO provide this info more reliably ?

TIA
Dave

Hi Dave,

It's a bug - CubeDef.LastProcessed returns the last time the server was restarted as far as I know. See
http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=124606

...for more details. Take a look at the comment posted by furmangg on April 28th on this entry on my blog for some code which does what you want:
http://cwebbbi.spaces.live.com/Blog/cns!7B84B0F2C239489A!675.entry

It's also available in the Analysis Services Stored Procedure Project here:
http://www.codeplex.com/Wiki/View.aspx?ProjectName=ASStoredProcedures&title=CubeInfo

HTH,

Chris

|||

Thanks Chris,

Its not resolved in SP1 either... Im going to check out AMO.

Cheers
Dave

|||FWIW AMO works for AS2005 when retrieving the last processed datetime. Doesnt work for AS2000 or local cubes.

adodb.connection > DBMS Name property equivalent in ADO.NET ...

Hi,

One of my team member was porting a Visual Basic function into VB.NET. We were struck up while retrieving the DBMS Name property from the connection object. Actually in VB, the ADODB.connection object's properties will have an item called DBMS Name which will hold the database name like "Oracle" , "Access" , "SQL Server" like that based on the database that I connect.

I wonder if there is any equivalent property in ADO.NET. The Server Version property of ODBCConnection object returns "8.0...." in case of SQL Server and returns "09.01.0000 Oracle9i Enterprise Edition Release 9.2.0.1.0" in case of oracle. This is not as precise as it's ADODB counterpart.

I'm hardly in need of a solution or workaround for this scenario. Can anybody help.

Thanks in advance.

Hi Prathap,

The .Net Framework Data Access and Storage forum is the best forum with which to seek your answer (I see that you've already posted this question there).

Il-Sung.

Saturday, February 25, 2012

ADODB - Cube connection error: Provider could not set DATASOURCE, USERID, or PASSWORD property

When attempting to connect to my cube from the same server, I receive this error:
"Provider could not set DATASOURCE, USERID, or PASSWORD property"

The connection works just fine from my machine, but when going from the server to the server, I profile it, and no connection attempts are made. The server is w2k3 SE sp1, and the successful client is win xp pro sp2.

The method I'm using is an adodb ConnectionClass in C# vs.net 2003. The adodb is using v2.8, and I used the component checker to make sure the server has 2.8 - it does.
I have the user name and password in the connection string,
"Provider=MSOLAP.3;Cache Authentication=True;Persist Security Info=False;Initial Catalog=thecatalog;Data Source=theServerName;"
calling the open like: cn.Open(ConnectionString, "theuser", "thepass", 0);
and if it successfully opens, then I make use of an adomd.cellset.

I'm currently checking component differences between the 2 machines, but does anyone have any specific things to try or specific components to check?

First I would make sure you can establish OLED connection from one machine to another.

You can find here some clues on how to troubleshoot connection problems: http://www.sqljunkies.com/WebLog/edwardm/archive/2006/05/26/21447.aspx

Second, as you already suggested, I would check configuration of components.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

ADODB - Cube connection error: Provider could not set DATASOURCE, USERID, or PASSWORD proper

When attempting to connect to my cube from the same server, I receive this error:
"Provider could not set DATASOURCE, USERID, or PASSWORD property"

The connection works just fine from my machine, but when going from the server to the server, I profile it, and no connection attempts are made. The server is w2k3 SE sp1, and the successful client is win xp pro sp2.

The method I'm using is an adodb ConnectionClass in C# vs.net 2003. The adodb is using v2.8, and I used the component checker to make sure the server has 2.8 - it does.
I have the user name and password in the connection string,
"Provider=MSOLAP.3;Cache Authentication=True;Persist Security Info=False;Initial Catalog=thecatalog;Data Source=theServerName;"
calling the open like: cn.Open(ConnectionString, "theuser", "thepass", 0);
and if it successfully opens, then I make use of an adomd.cellset.

I'm currently checking component differences between the 2 machines, but does anyone have any specific things to try or specific components to check?

First I would make sure you can establish OLED connection from one machine to another.

You can find here some clues on how to troubleshoot connection problems: http://www.sqljunkies.com/WebLog/edwardm/archive/2006/05/26/21447.aspx

Second, as you already suggested, I would check configuration of components.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Sunday, February 19, 2012

ADO MaxRecords and table variables

It appears that when I specify the MaxRecords property in ADO to something other than 0, not only does SQL Server 2000 limit the number of rows that are being returned from a stored procedure, it also limits the number of "select into"s within the stored proecudre (I'm inserting into table variables within the proc).

Here's a scenario of why this is a problem. Suppose I have a proc that needs to perform calculations on all employees in my system (10,000 of them). The calculation is performed by selecting these employees into a table variable with some calculated values being inserted as well. When the processing is complete, I need to select the top 1500 employees from the table.

If I specify MaxRecords in ADO, the "select into" statement that populates my table variable appears to limit the number of rows to 1500. This is a problem if I'm expecting an employee outside of the first 1500 to be considered for the calculations I'm performing.

Is there some way of indicating that MaxRecords should be ignored when selecting into table variables or temporary tables within a stored proc?

Thanks,
TerenceI know I could simply use "top" in the last select statement of the stored procedure to get around this problem, however, this is not an option on the system I'm currently developing (for design reasons (possibly poor design reasons now that I think about it ;) ))

Thanks again,
Terence