SQL Server Developer Center > SQL Server Forums > SQL Server Compact > Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Ask a questionAsk a question
 

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

  • Tuesday, January 01, 2008 7:38 AMAlphacaliboy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    I'm new to ADO.NET and need help with this error.

     

    Currently running Vista Home Premium 64 and Visual Studio 2008 Trial.

     

    1. Create Win form app.

    2. Add new data source...

    3. New connection - SQL Server Compact 3.5 - Northwind.sdf

    4. Highlight Products and Suppliers.

    5. Drag both onto Win form

    6. Run with debug

    7. Error message "Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

     

    some blogs advice change dir in SQL Server Compact 3.5 in regedit but regedit doesn't even have SQL Server Compact 3.5; only SQL Server\SQLExpress.

     

    reinstall SQL Server Compact 3.5 and problem still exists.

     

    anyone knows how to fix this problem?

     

Answers

All Replies

  • Wednesday, January 02, 2008 3:31 PMJoão Paulo FigueiraMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Laxmi blogged about this issue here:

    Can’t find P/Invoke DLL sqlcemeNN.dll

  • Wednesday, January 02, 2008 5:20 PMAlphacaliboy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I installed the SP3 for SQL CE and even reinstalled it but problem still exists.

     

    I don't understand this part:

    "You are using Visual Studio Auto Deployment (F5) feature.  And, VS has failed to map the System.Data.SqlServerCe.dll to the right set of cabs to install and just deployed the System.Data.SqlServerCe.dll alone (Note: No error is thrown).  In this case, the native DLLs are not deployed.

    a.       Fix the auto-deployment issues (Don’t ask me how L)

    b.      Manually copy and install the SQL CE Cabs (all the 3 cabs).  They are located under:

    %VisualStudioInstallRoot%\SmartDevices\SDK\SQL Server\Mobile\v3.0\<platform>\<processor>"

     

    Can you clarify to where all the 3 *.cab support to go to?

     

     

  • Sunday, January 06, 2008 4:49 PMJeff Zuerlein Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I'm seeing the same problem with Beta 2 of Visual Studio 2008 on Vista Ultimate x64.

    I'm unclear about where the cab files go as well.

     

    Jeff

     

  • Sunday, January 06, 2008 6:32 PMErikEJMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Have you set your solution target to "Any CPU" ?? If so, set to "x86", as SQL Compact only runs in WoW mode on x64. Or use corflags.exe /32BIT+ against your project output (.exe file).

  • Sunday, January 06, 2008 6:41 PMAlphacaliboy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    set to x86 and it works....thanks

  • Wednesday, January 09, 2008 8:29 PMhottcarl Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Maybe I'm dumb, but I can't seem to find this option.

    Under Advance Compile Options the only thing I see similar to this is Target Framework, but that doesn't fix it either.

    I'm running VS2008 Express under Vista Ultimate x64
  • Wednesday, January 09, 2008 9:19 PMErikEJMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    It is part of the solution configuration, not project properties. "Configuration Manager" (that's what you need) is usually available via the dropdown saying "Debug", "Release"  For more info see: http://msdn2.microsoft.com/en-us/library/t1hy4dhz.aspx

    Or you can use corflags.exe /32BIT+ against your .exe file after build and before deployment.

  • Wednesday, January 09, 2008 9:24 PMAlphacaliboy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I'm using the MV2008trial but i think the layout still the same.

    You should be able to see a button on your toolbar that looks like a "play button" (start debugging) next to it you should see a drop down box said "Debug" and next to it is another drop down box and its default value is Any CPU; set this to x86.

     

    this works on mine.

  • Wednesday, January 09, 2008 10:14 PMhottcarl Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I can't find this anywhere.  I'm assuming it must be because it the express edition.  Downloading the trial now...
  • Wednesday, January 09, 2008 10:16 PMhottcarl Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Found it... had to enable advance build configurations under options... thanks guys.
  • Monday, February 11, 2008 4:53 PMAkito Tenkawa Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    ive tried everything stated here but no luck, i still cant run my solution, keep getting:

    An error occurred creating the form. See Exception.InnerException for details.  The error is: Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

    Plus, in the compiler, advanced compiler options i cant switch the Target CPU, its fixed to "Any CPU"

    Im using Windows Vista Business 64 and Visual Basic 2008 Express Edition
  • Sunday, February 17, 2008 9:49 AMizyrajder Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer

    I had the same problem in Ulimate. Try this.

     

    In drop nemu "Build" is "Configuration Manager". You will see the tabel where one of columns is the column "platform" with Any CPU. There is drop menu. Use "New" option a then change this option on x86. It helps me. Close Configuration manager and try.

    • Proposed As Answer byBacter Tuesday, May 05, 2009 12:54 PM
    •  
  • Sunday, February 17, 2008 10:27 AMErikEJMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Look at this blog post for a walk-through: http://erikej.blogspot.com/2008/01/x64-and-sql-compact.html

     

  • Tuesday, April 01, 2008 7:31 PMboston_ma Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     ErikEJ wrote:

    Have you set your solution target to "Any CPU" ?? If so, set to "x86", as SQL Compact only runs in WoW mode on x64. Or use corflags.exe /32BIT+ against your project output (.exe file).

     

     ErikEJ wrote:
    Look at this blog post for a walk-through: http://erikej.blogspot.com/2008/01/x64-and-sql-compact.html

     

     

    Hello everyone,

     

    I have the same problem as mentioned above "Unable to load DLL 'elev.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) ", when trying to load the dll file into a window application.  I developed a window application in VS2005 and want to import a dll file from another program into my project and use it.  But when I try to call one of the function in the dll file, I got the error message "Unable to load dll 'elev.dll".  I try all options that say it works to solve this problem, but somehow it doesn't work for me. I put the "elev.dll" file in the bin folder and use P/Invoke to import the dll file into my project.  Can anyone help me out with this?  thanks and really appreciated!

     Here is how I import the dll:

     

    [DllImport(@"D:\elev.dll")]

    //[DllImport("emap.dll", SetLastError = true)]

    private static extern void EMA_Init();

     

     

    and in the code,  I call the function above but failed to load the dll file

    EMA_Init();

  • Wednesday, April 09, 2008 5:56 AMFultron66 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am new to programing of any kind.  You link did the trick, once I actually read it.  Thank you.

     

  • Friday, April 18, 2008 9:44 AMJirapong Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi all,
           i also get stuck with this... at last i get it work.

    you may need to copy *.dll from C:\Program Files\Microsoft SQL Server Compact Edition\v3.5
    to C:\Program Files\Microsoft Visual Studio 8\Common7\IDE (For VS2005)
    or C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE (For VS2008)

    That's it.

    Hope this helps,
    -Jirapong


  • Sunday, February 01, 2009 12:59 AMadam75 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    installing SP1 for Sql Server Compact fixes the Vista64 bit problems for me

    http://www.microsoft.com/downloads/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en#filelist

     

     

  • Monday, April 27, 2009 7:44 PMExistMe Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    installing SP1 for Sql Server Compact fixes the Vista64 bit problems for me

    http://www.microsoft.com/downloads/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en#filelist

     

     

    Thankyou adam75 actually it solved my problem on my 64bit vista machine.
  • Wednesday, May 20, 2009 12:30 PMBrianJacobs Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    The really good news is that they haven't fixed this in Windows 7, but this fix works in 7 rc1.

    You have to install both the x86 and x64 patches. 
  • Tuesday, June 23, 2009 8:14 PMHugh Fairfield Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

    I am seeing a similar issue except for 32 bit machines.

    Installing the service pack for sql compact from the link (http://www.microsoft.com/downloads/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en#filelist) resolves the issue but when sql compact is installed through the click once, it gives this error("Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)").

    We are trying to have an application where everything for the application is installed through the click once technology, but it does seem that this doesn't want to work.

    Does anyone have any ideas why this install won't work on certain machines through the click once?

    thx!

    Hugh Fairifeld
  • Saturday, July 11, 2009 12:51 AMnobugzMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You'll have to install the x64 version of SQL Compact.  Ask more questions about it in this forum.

    Hans Passant.
  • Thursday, August 13, 2009 5:25 PMEckemoff Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    There are posts that over complicate this issue.

    The problem is that you are using a 64 bit operating system, but have installed the 32 bit version of SQL Server Compact Express. When you attempt to run a windows form application in Visual Basic 2008, windows can not find the correct file. Though you can develop with the standard 32 bit version of SQL Server Compact Express using a 64 bit operating system, you must have a separate program to run what you develop. 



    Solution:

    Download and install a program that allows a 64 bit operating system to run SQL Server Compact Express (.sdf).

    Here is the link: http://www.microsoft.com/downloads/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en#filelist

     
  • Tuesday, September 08, 2009 9:28 PMJon Sagara Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    installing SP1 for Sql Server Compact fixes the Vista64 bit problems for me

    http://www.microsoft.com/downloads/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en#filelist

     

     

    This also fixes the problem for me on Windows Server 2008 R2 x64.
    • Edited byJon Sagara Tuesday, September 08, 2009 9:28 PMSpecified that I'm using x64
    •  
  • Thursday, September 24, 2009 8:47 AMGnostyk Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Erik, you are the man!  Thank you so much for providing the solution to the "sqlceme35.dll not found" exception.  Now I don't have to fork over 60 bucks to migrate to Liberty BASIC.
  • Saturday, October 17, 2009 5:26 AMDaveBic Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I am writing an application in VB using Visual Studio 8. I cannot run the published application on any 64 bit machine. I have changed the solution target to "x86" as per your blog using the instructions you have given and it still will not run. I bought a new 64 bit system to test with and it still will not run. I get this message no matter what I have tried to do. "Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)" I originally created the application on a 32 bit machine and then loaded the Visual studio application onto the 64 bit system to publish from there and it will run in debug mode within visual studio no matter what settings I use for the target solution but whenever I try to publish it the publisher shows "Any CPU" as the configuration and will not run when I install the application. I am using the "One Click" deployment option from a CD to deploy the application. I have even rewritten the entire application with the target platform set to "x86" to no avail. I have spent many hours on this problem and I must find a solution. To not run on a 64 bit system is not acceptable. Any ideas on what I am doing wrong? Will Microsoft ever address this issue? I am using the SQL compact edition database and I understand this is the problem with the database. My application still starts if I ignore the error but of course no data is present. Any help you can give me will be appreciated. I cannot expect the users to use the "corflags.exe /32BIT+ solution because I cannot even get that to work. I am new to the .Net world and cannot get the corflags.exe command to work no matter where I type the command. Is this something I can do to my .exe file before I place on the CD to deploy? If so maybe some more detailed instructions on how to do this will help. Thank you in advance for anything you can tell me.

  • Sunday, November 15, 2009 2:06 PMNe0nE Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    I am working with SQL Compact 3.5 on Windows 7 x64 build, and I had this same error. The steps I took based on this topic worked.

    I installed Sql Compat 3.5 SP1, opened up my project, under the configuration manager I set my CPU to x86, ran the project again and the DLL error was gone, and my program was working perfectly.

    Thanks for the help.
  • Tuesday, January 05, 2010 11:44 PMrobinmitra Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks Erik! That fixed the problem!