Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
QIAO
Helper II
Helper II

OLE DB or ODBC error: Unable to cast object of type 'EmptyColumn'

When I load an empty table, Power BI throw exception like "OLE DB or ODBC error: Unable to cast object of type 'EmptyColumn' to type Microsoft.OldDb.Column".

It would run okay when the table is not empty.

And here are the part of logs:

[DEBUG][2018-01-24.17:39:07]RestFetchMoreResults called, AthenaClient:00000258E45D2AE0
[DEBUG][2018-01-24.17:39:07]AthenaClient::fetchMoreResult called
[DEBUG][2018-01-24.17:39:07]AthenaClient::CreateColumnDescriptor called, Label:osname, CataLogName:hive, SchemaName:, TableName:, ColumnName:osname, ColumnType:varchar
[DEBUG][2018-01-24.17:39:07]RestFetchMoreResults returned, ColumnCount:1, RowCount:0
[DEBUG][2018-01-24.17:39:07]SQLMoreResults returned, RetCode:SQL_NO_DATA
[DEBUG][2018-01-24.17:39:07]SQLFreeHandle called, HandleType:SQL_HANDLE_STMT, Handle:00000258E4573830
[DEBUG][2018-01-24.17:40:13]SQLGetInfoW called, InfoType:SQL_MAX_CONCURRENT_ACTIVITIES, BufferLength:2
[DEBUG][2018-01-24.17:40:13]SQLGetInfoW returned
[DEBUG][2018-01-24.17:40:13]SQLDisconnect called
[DEBUG][2018-01-24.17:40:13]SQLDisconnect returned
[DEBUG][2018-01-24.17:40:13]SQLFreeHandle called, HandleType:SQL_HANDLE_DBC, Handle:0000021DDE102190
[DEBUG][2018-01-24.17:40:13]SQLFreeHandle called, HandleType:SQL_HANDLE_ENV, Handle:0000021DDE127060

1 ACCEPTED SOLUTION

Solved, it's because SQLExecute should return SQL_SUCCESS instead of return SQL_NO_DATA when load empty table.

View solution in original post

5 REPLIES 5
v-chuncz-msft
Community Support
Community Support

@QIAO,

 

You may check code in The Advanced Editor.

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

The code is no difference.

shared test1 = let
Source = ThriveConnector.Database("us-west-2"),
thrive_mobiledevelopment_Database = Source{[Name="thrive_mobiledevelopment",Kind="Database"]}[Data],
test1_Table = thrive_mobiledevelopment_Database{[Name="test1",Kind="Table"]}[Data]
in
test1_Table;

And power bi know it's an empty table. And here shows 2 tables:

WeChat Image_20180126112512.png

 

But it would throw error when load the data. And if you return to main window, you can only see 1 table.

WeChat Image_20180126112753.png

 

 

What happened to the test1 table?

(1/26/2018 10:53:29 AM) Message: Started listening on TCPIP: Status = ListenToPortSuccess, ComputerName = DESKTOP-FR15DM5, PhysicalNetBIOSName = DESKTOP-FR15DM5, ListenOnIP = ::1, Port = 4518, ProtocolType = IP6 (Source: \\?\C:\Users\QQQ\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces\AnalysisServicesWorkspace722381719\Data\msmdsrv.log, Type: 1, Category: 289, Event ID: 0x4121001C)
(1/26/2018 10:53:29 AM) Message: Started listening on TCPIP: Status = ListenToPortSuccess, ComputerName = DESKTOP-FR15DM5, PhysicalNetBIOSName = DESKTOP-FR15DM5, ListenOnIP = 127.0.0.1, Port = 4518, ProtocolType = IP4 (Source: \\?\C:\Users\QQQ\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces\AnalysisServicesWorkspace722381719\Data\msmdsrv.log, Type: 1, Category: 289, Event ID: 0x4121001C)
(1/26/2018 10:53:29 AM) Message: Software usage metrics are disabled. (Source: \\?\C:\Users\QQQ\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces\AnalysisServicesWorkspace722381719\Data\msmdsrv.log, Type: 1, Category: 289, Event ID: 0x4121000E)
(26/01/2018 10:53:29 AM) Message: The resource file 'msmdsrvi.rll' for locale '5129' could not be loaded. Switching to US English (1033) if available. (Source: \\?\C:\Users\QQQ\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces\AnalysisServicesWorkspace722381719\Data\msmdsrv.log, Type: 3, Category: 289, Event ID: 0xC1210019)
(1/26/2018 11:00:46 AM) Message: OLE DB or ODBC error: Unable to cast object of type 'EmptyColumn' to type 'Microsoft.OleDb.Column'.. (Source: \\?\C:\Users\QQQ\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces\AnalysisServicesWorkspace722381719\Data\msmdsrv.log, Type: 3, Category: 289, Event ID: 0xC1210003)

Solved, it's because SQLExecute should return SQL_SUCCESS instead of return SQL_NO_DATA when load empty table.

@QIAO,

 

Glad to hear that. You may help accept the solution above. Your contribution is highly appreciated.

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.