Solve error on connectiong Access Database - .Net Framework project

VKSB 236 Reputation points
2026-10-06T10:18:52.2866667+00:00

On using "Add New Data source", on the "Data Source Configuration Wizard" after selecting the "Tables" and clicking the "Finish" button I get this error message. I am using Visual Basic for programming using Visal Studio 2022.

Error message:

"Some updating commands could not be generated automatically. The database returned the following error:

**Could not load file or assembly 'Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=neutral,PublicKey Token=23ec7fc2d6eaa4a5' or one of its dependencies. The system cannot find the file specified."

**Could any of the experts help me to solve this problem please?

Thanks

VKSBK

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.


1 answer

Sort by: Most helpful
  1. Brian Pham (WICLOUD CORPORATION) 250 Reputation points Microsoft External Staff Moderator
    2026-10-07T12:02:19.88+00:00

    Hello @VKSB ,

    Thank you for reaching out. I sincerely apologize for the delay, and I am happy to support you now.

    From the information shared, you can connect to the Access database and select the tables, but the Data Source Configuration Wizard fails after you click Finish with your error:

    SqlClient is normally used with SQL Server, while Microsoft Access should use the OLE DB provider. This suggests the issue may be related to the project configuration or the Visual Studio Data Tools installation, rather than the Access database file itself.

    Please try the following steps:

    • Confirm that the project is a Visual Basic Windows Forms App (.NET Framework) or WPF App (.NET Framework), rather than a .NET 6, 7, or 8 project.
    • Recreate the connection and select:
      • Microsoft Access Database File
      • .NET Framework Data Provider for OLE DB
    • In References and Manage NuGet Packages, check whether the project contains:

    User's image

    If your application uses only Access and these packages were added during troubleshooting, remove them. Then close Visual Studio, delete the project’s bin and obj folders, reopen the solution, and rebuild it.

    • Create a new Visual Basic Windows Forms App (.NET Framework) project and try connecting to the same Access database.
      • If the new project works, the original project likely contains an incorrect or damaged reference.
      • If the new project shows the same error, the Visual Studio installation or Access provider may require repair.
    • Open Visual Studio Installer, confirm that the .NET desktop development workload is installed, install available updates, and use More > Repair if the problem continues.

    Please also verify that the selected tables have a primary key, as the wizard may be unable to generate update commands for tables without one.

    If the error remains, please share:

    1. The exact Visual Studio version
    2. The target .NET Framework version
    3. Whether the database is .accdb or .mdb
    4. Whether Microsoft Office or the Access Database Engine is 32-bit or 64-bit
    5. Whether the same error occurs in a newly created project

    Once again sorry for the delay, I am appreciating your patience and will use the above information to identify whether the issue is specific to the project or the Visual Studio installation.

    If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation. Thank you.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.