python.exe crashes while executing query from server

168 Views Asked by At

I'm trying to execute tiny mdx query from Analysis Service server at work. Server provides data via ms ole db, not odbc specification, thats why i use adodbapi library.

Here's the function i use to obtain result from query execution:

def mdx_query (query):
    conn = adodbapi.connect("PROVIDER=MSOLAP; \
                         persist security info=true; \
                         Data Source=***; \
                         initial catalog=analyse;")
    cursor = conn.cursor()
    try:
        cursor.execute(query)
        result = cursor.fetchone()
    except (adodbapi.Error, adodbapi.Warning) as e:
        print(e) 
    cursor.close()
    del cursor
    conn.close()
    del conn

    return result

Primitive single-value queries works perfectly well:

select 
[Physical Stock PCS] on 0, 
[Goods].[Categories].[ALL] on 1 
from [analyse]

If i got syntax error it also just give me adodbapi.Error message and it's fine.

But if I try to execute more complex queries like:

select 
[Physical Stock PCS] on 0, 
[Goods].[Categories].[Level 01] on 1 
from [analyse]

[Goods].[Categories].[Level 01] have more than one dimension and i always got python.exe APPCRASH message no matter what.

I tried both python 2 and 3, running in jupyter and console mode,pandas.read_sql_query method. Result is always the same - i get APPCRASH window.

How to cure crashes and finally execute complicated queries? Any help is appreciated!

UPD:here's error window. Can't change it to EN.Appcrash error

0

There are 0 best solutions below