Showing results for 
Search instead for 
Did you mean: 
New Member

Power BI Custom ODBC driver data paging not working as expected

I am testing my ODBC Driver using ODBCTest app. ODBC V3
When I use this test app the Driver returns all the selected data I query. Ex select * from table.

However I have an issue with my custom ODBC driver when it is used by Apps like PowerBi or Excel. Ill be using PowerBi for this post.
The problem is when I query data the SQLExecDirect will be called.
This seems to work fine returning the first 100 records.

Problem is when I do a select on a table with more than 100 record it doesn't seem to finish the sequence of calls to actually get the rest of the data.
Currently the function calls that do happen are
SQLColAttribute //This is being called a couple of times
SQLGetData //Called until 100 results are proccessed
SQLFetch //Gets called mostly with SQLGetData

/*Once all returned rows from SQLExecDirect the next function is called.*/


/*This is where the trouble starts*/

The problem starts because even though the next 100 rows are fetched and packaged for the App to use, neither SQLFetch or SQLGetData is being called from the Apps side.
I have implemented SQLFetchScroll, SQLExtendedFetch, SQLBulkoperation and None of them seem to get called either.

I have tried returning both SQL_SUCCESS_WITH_INFO and SQL_SUCCESS but the app still seems to not call anything else after SQLMoreResult.
Interesting thing however is that it does seem to call SQLMoreResult again and again until the records in that table are all processsed.

It just seems like the APP does not know that there are records/data ready for it to "FETCH" or "GET".

I have tried setting the sizes of this piointer
SQL_ATTR_ROW_ARRAY_SIZE although this always seems to be reset to 1

SQL_ATTR_ROW_STATUS_PTR -> The pointer to the data buffer should remain the same since I only change the data inside.

The GetEnvAttr() function never seems to be called by PowerBi:

This is the STM Attrs being set upon connection:
GetStmtAttr: 10010 out_value=000001E532809870 out_value_max_length=-4
GetStmtAttr: 10011 out_value=000001E532809978 out_value_max_length=-4
GetStmtAttr: 10012 out_value=000001E532809A80 out_value_max_length=-4
GetStmtAttr: 10013 out_value=000001E532809B88 out_value_max_length=-4

But none of these are being called


Community Support
Community Support

Hi @mariusmans ,

Please review the following documentation and check whether it hit any limitation:

Getting Long Data

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This deals with the ODBC driver, we have that working. Our issue is that Power BI and Excel does not call this inteface.

Helpful resources

PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Kudoed Authors