logo
search
Others

How to Fix acedao.dll Memory Leaks Using DAO Seek in C#

Huda QurayshiHuda Qurayshi Sep 30, 2026 869 views

Question details

The user needs to resolve a memory leak in acedao.dll caused by repeated DAO Seek operations in a C# application.

How to Fix acedao.dll Memory Leaks When Using DAO Seek
Product
Microsoft Access 365
Device & OS
not provided
Scenario
Executing repeated Seek operations on a table-type recordset using Microsoft Access DAO in a C# application.
Observed behavior
The application leaks memory through acedao.dll, leading to excessive memory consumption.
Before you start

Ensure you have access to the C# application source code and that your development environment is set up to compile and debug Microsoft.Office.Interop.Access.Dao references.

Solution 1Recommended

Explicitly Dispose Unmanaged DAO Objects

Properly close and release unmanaged COM objects to prevent memory leaks during repetitive tasks.

DAO objects are unmanaged resources. When accessed via C#, the .NET Garbage Collector does not automatically release the underlying COM objects immediately. This leads to apparent memory leaks during repetitive tasks like Seek operations.

1
Identify DAO objects

Locate all database and recordset objects in your C# code that utilize DAO Seek.

2
Implement using statements

Wrap your DAO operations within 'using' statements or 'try-finally' blocks to ensure resources are predictably managed.

3
Close connections manually

Explicitly call the 'Close()' method on recordsets and databases as soon as they are no longer needed in the execution flow.

4
Release COM objects

Use 'System.Runtime.InteropServices.Marshal.ReleaseComObject()' to safely decrement the reference count of the unmanaged DAO COM objects.

Explicitly Dispose Unmanaged DAO Objects
VB6 to C# Migration: If your application was converted from VB6, automatic object disposal might be missing. Manually adding these cleanup blocks is critical for C#.
Free Microsoft Office alternative

Looking for a Lightweight Office Alternative?

While specialized database integrations like DAO require specific Microsoft tools, everyday document processing shouldn't be complicated or prone to heavy memory usage. WPS Office offers a free, lightweight, and highly compatible alternative for handling spreadsheets, documents, and presentations.

  1. 1. Download the installer: Visit the official WPS Office website and download the free installation package.
  2. 2. Install the software: Run the setup file and follow the on-screen instructions to complete the installation.
  3. 3. Open existing files: Launch WPS Office to instantly open, edit, and save your existing Microsoft Office documents seamlessly.
Fully compatible with Microsoft Office formats including .docx, .xlsx, and .pptx.Lightweight design that minimizes memory consumption and system freezes.Familiar user interface ensuring seamless migration without a steep learning curve.Built-in PDF tools and advanced data processing features for everyday office tasks.
QA img-9

Frequently Asked Questions

Why is Seek used instead of standard ADO.NET queries?

Seek is a DAO-specific operation that bypasses the SQL parser and query planner, making it significantly faster for certain index-based database lookups. However, it is not available through standard ADO.NET and requires careful manual memory management.

Can I use OLE DB or ODBC to avoid this memory leak?

Yes, OLE DB or ODBC are excellent alternatives for normal database access and standard queries in .NET. However, if your application relies specifically on the performance benefits of DAO Seek, you must explicitly manage COM object disposal instead of switching technologies.

Why does the leak only appear in C# and not in the original VB6 application?

VB6 utilizes deterministic reference counting, immediately releasing COM objects when they go out of scope. C# uses a non-deterministic garbage collector, meaning unmanaged COM objects like acedao.dll can linger in memory unless they are explicitly released by the developer.