sqlite

Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)


I am currently using SQLite for Windows Forms but while running the project it is showing the error:

Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I had added the DLL of System.Data.SQLite.dll but it is showing the same error. Please can any one help me by giving the perfect answer regarding this problem? Thanks in advance


Solution

  • Maybe you haven't added the version for the right platform? SQLite is distributed with one X86 (32 bit) assembly and one X64 (64 bit) assembly.

    If your application is a 32 bit application you should use the System.Data.SQLite.dll located in the "bin" directory of the System.Data.SQLite distribution, if it is a 64 bit application you should use the one in "bin\x64".

    However, from looking at the error message a second time I'm not sure if that's it. Are you making native calls to SQLite? In that case you may have to rename the dll to sqlite3.dll.

    As you may know System.Data.SQLite is a bundling of the original native sqlite3.dll and a managed ADO.NET provider (unless you are using some old version in which case I'm not sure - you might need the native sqlite3.dll separately)