ODBC xlsx- Attempt to make a 2nd new connection fails-External table is not in the expected format

Copper Contributor

I am running a 32-bit windows application (C++) to read a table from excel file in *.xlsx format using the ODBC dsn.

The ODBC dsn uses the Microsoft Excel Driver(*.xls, *.xlsx, *.xlsm, *.xlsb) with the 'Read Only' option set.

The application is able to connect successfully for the 1st time.
But any attempt to make a new connection fails if previous connection is kept open.
The SQLConnect() fails with error - 'External table is not in the expected format'

The issue is reproducible for xlsx files.  No such issue for xls files. 

The issue is still reproducible even if 2 different ODBC dsns are used that access the same xlsx file.

However,
The application is able to make multiple connections ONLY if the same xlsx file is kept opened in 'Office Excel'.

I also tried different versions of Excel driver(*.xls, *.xlsx, *.xlsm, *.xlsb) - Office 2010, 2013 and 2016.

Is there any other way to allow multiple connections ? 

0 Replies