Data Import & Export

Fix ACE.OLEDB.12.0 Limiting Excel Queries to 65,535 Rows

Aamir Naveed AkramAamir Naveed Akram Oct 26, 2026 868 views

Question details

Users experience a row truncation issue where querying an Excel file using the ACE.OLEDB.12.0 provider only returns 65,535 rows, despite the file containing over a million rows.

How to Fix ACE.OLEDB.12.0 Limiting Excel Queries to 65,535 Rows
Product
Microsoft Excel
Device & OS
not provided
Scenario
Querying large Excel datasets via the ACE.OLEDB.12.0 provider in a custom application, script, or database tool.
Observed behavior
The query silently truncates the dataset, returning a maximum of exactly 65,535 rows instead of the full dataset available in the modern Excel format.
Before you start

Ensure you have administrative privileges to install or update database drivers on your system, and verify the exact bit-version (32-bit or 64-bit) of the application executing the query.

Solution 1Recommended

Update and Verify Microsoft Access Database Engine Architecture

Installing the latest driver and matching the architecture (32-bit or 64-bit) to your application often resolves row limitation issues caused by outdated components.

The 65,535 row limit is a remnant of the older Excel 97-2003 (.xls) format. If the OLEDB provider is outdated or mismatched in architecture, it may mistakenly treat newer .xlsx files as legacy formats.

1
Check Application Architecture

Determine whether the application or script environment executing the OLEDB query is running in 32-bit or 64-bit mode.

2
Download the Latest Driver

Navigate to the official Microsoft download center and search for the latest 'Microsoft Access Database Engine Redistributable'.

3
Install the Matching Version

Download and install the architecture version (32-bit or 64-bit) that strictly matches your application's environment, not necessarily your Windows OS architecture.

4
Restart and Test

Restart your application or IDE, then re-run the query to confirm that data beyond 65,535 rows is successfully retrieved.

Update and Verify Microsoft Access Database Engine Architecture
Compatibility Note: Always ensure that the file extension in your connection string accurately reflects the file type (.xlsx instead of .xls) to prevent legacy fallbacks.
Free Microsoft Office alternative

Handle Large Datasets Smoothly with WPS Office

If you are struggling with Microsoft driver limits or legacy Excel compatibility issues, WPS Office offers a modern, lightweight, and highly compatible alternative. It natively handles worksheets with over a million rows without requiring complex OLEDB driver configurations.

  1. 1. Download WPS Office: Visit the official WPS Office website and download the free software suite.
  2. 2. Install the Software: Run the lightweight installer and open WPS Spreadsheet on your computer.
  3. 3. Open Your Large Dataset: Open your .xlsx file directly to view, analyze, and manage all 1,048,576 rows without OLEDB driver restrictions.
Fully compatible with Microsoft Excel formats (.xlsx, .xls, .csv)Natively supports up to 1,048,576 rows per worksheetLightweight installation with a familiar user interfaceNo complex database driver configurations required for large datasets
microsoft office alternative - wps office

Frequently Asked Questions

Why does ACE.OLEDB.12.0 stop at exactly 65,535 rows?

The number 65,535 corresponds to the maximum row limit of the older Excel 97-2003 (.xls) format. The OLEDB provider might be misinterpreting the modern .xlsx file as an older .xls file due to outdated drivers, incorrect extended properties in the connection string, or a mismatch in architecture.

Does setting IMEX=1 always fix the row limit issue?

No. IMEX=1 is primarily intended to handle columns with mixed data types by reading them as text. If your data is purely numeric, setting IMEX=1 may not change the row limitation result. In such cases, updating the driver architecture is the recommended solution.

How do I know if I need the 32-bit or 64-bit Access Database Engine?

The required architecture depends entirely on the application executing the query, not your Windows operating system. If you are using a 32-bit Python environment, a 32-bit C# application, or a 32-bit Office installation, you must install the 32-bit database driver.