How to Fix Access Database Engine 2016 255-Column Limit in Excel
Question details
The user needs to read more than 255 columns from an Excel file programmatically using C# and Microsoft Access Database Engine 2016, but is hitting a hard limitation.

- Product
- Microsoft Access Database Engine 2016
- Device & OS
- not provided
- Scenario
- Reading a large Excel dataset programmatically via OleDbDataReader in a C# application.
- Observed behavior
- The query returns only 255 columns from the Excel range, dropping any columns beyond the 255th.
Ensure you have the exact column names or indices you need to query, and back up your original Excel dataset before running segmented programmatic queries.
Split the Excel Range into Multiple Queries
Bypass the hard 255-column limit by executing multiple queries, each fetching a specific subset of columns, and combining them in your application.
Microsoft Access Database Engine 2016 has an inherent limitation where a single SELECT statement can only retrieve a maximum of 255 columns. Using 'SELECT *' on wider sheets will silently truncate the remaining columns.
Instead of using 'SELECT *', specify distinct column ranges in your SQL queries. For example, query columns 1 to 250 in the first query, and 251 to 500 in the second.
Adjust your OleDbCommand text to target the specific ranges, such as 'SELECT * FROM [Sheet1$A:IQ]' for the first batch.
Execute the OleDbDataReader for each query and programmatically merge the DataTables or objects in your C# application based on a common key or row index.

Use an Alternative Library like ExcelDataReader
Replace Microsoft Access Database Engine with a modern, lightweight library that does not have the 255-column limit.
Manage Large Datasets Effortlessly with WPS Office
While Microsoft Access Database Engine restricts your programmatic data queries to 255 columns, you may need a reliable, high-performance spreadsheet tool to actually view, edit, and organize these massive datasets. WPS Office is a lightweight, fully compatible alternative that easily handles huge spreadsheets without breaking a sweat.
- 1. Download WPS Office: Visit the official WPS website and download the free installer for your operating system.
- 2. Install the Application: Run the downloaded installer and follow the on-screen instructions to set up WPS Office on your device.
- 3. Open Large Excel Files: Launch WPS Spreadsheet, go to 'Menu' > 'Open', and select your wide dataset to view all columns seamlessly.

Frequently Asked Questions
Why does OleDbDataReader drop columns after 255?
This is a legacy limitation inherent to the Microsoft Access Database Engine (OLEDB provider), originally stemming from older Excel and Access formats (.xls, .mdb) that only supported up to 255 columns natively.
Does upgrading to a newer Access Database Engine fix the 255-column limit?
No, even the newer Microsoft Access Database Engine 2016 distributable retains this 255-column architectural limit for a single SELECT query.
How many columns can an Excel file actually hold?
Modern Excel files (.xlsx) can hold up to 16,384 columns. You need a more robust reading method, like third-party libraries or split queries, to retrieve all of them programmatically.




