cancel
Showing results for 
Search instead for 
Did you mean: 

Error accessing ADOMD.Cellset retrieved from HANA

colin_overton
Explorer
0 Kudos

Hi all,

I'm trying to access a HANA database using ADODB/ADOMD. My code is in C#, .Net4

Once I have an ADOMD.Cellset I can access the cells, but get errors accessing the members.

When calling ADOMD.Axis.Positions[0].Members.Count an exception is thrown:

Failed to get rows.

   at ADOMD.Members.get_Count()

(I check Positions.Count > 0 before doing this)

Has anyone seen this, or have any advice on what I'm doing wrong? Are there alternate approaches I'm missing?

Sample code:

                //open the cellset, adoCellset

                //

                for (int i = 0; i < adoCellset.Axes.Count; i++)

                {

                        ADOMD.Axis axis = adoCellset.Axes[i];

                        LogMessage("got axis " + axis.Name);

                        LogMessage("dimension count : " + axis.DimensionCount.ToString());

                        LogMessage("tuple count : " + axis.Positions.Count.ToString());

                        if (axis.Positions.Count > 0)

                        {

                            ADOMD.Position tuple = axis.Positions[0];

                            var mems = tuple.Members;

                            LogMessage("got mems");

                            LogMessage("got tuple: " + tuple.Members.Count.ToString());    //  this line errors!!

                            for (int j = 0; j < tuple.Members.Count; j++)

                            {

                                var mem = tuple.Members[j];

                                var memun = mem.UniqueName;

                                LogMessage("got mem, " + memun);

                            }

                        }

                    }

Other info:

I can open a connection okay (ADODB.Connection.Open)

I can retrieve metadata okay (ADODB.Connection.OpenSchema)

I can access the Cellset values okay (ADOMD.Cellset[index].Value)

I have attached a sample project in case that is of any use, but if you'd like me to post some more sample code please just ask.

(It's a zip renamed to a txt file, as zips aren't allowed)

Thanks

Colin

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Did you solved the problem?

This is really strange to me.

i am facing the same problem

Regards

kai

Former Member
0 Kudos

Did you solved the problem?

This is really strange to me.

i am facing the same problem

Regards

kai