none
Convert .sdf to .mdb or .xls

    Question

  • I am trying to either find an easy to use program, or a way to write my own program to convert a windows mobile .sdf database file to a Access or Excel file.  It needs to be able to be distributed to our clients easily, without needing to install a lot of extra applications.

    I saw that there is a way to convert .sdf to Excel using sqlce and sqlserver.  Doing it this way would require that all of our clients had sqlserver, right?  Is that the only way?

    Any help or sample code would be greatly appreciated.  Code can be in VB or C#.

    Thanks,
    Jeff
    Thursday, December 13, 2007 4:34 PM

Answers

  • Hi,

     

    SQL Server everywhere was the intiall name of SQL Server Compact Edition. If you installed correctly sql server compact edition 3.1 in your machine you would'n have  problems insteed.

     

    About sqlceme30.dll exception, try installing sql server compact edition in the device.. you'll find cabs at C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0\wce500.

     

    best regards,,,

    Thursday, December 13, 2007 11:43 PM

All replies

  • I found this tutorial:
    http://www.codeproject.com/KB/database/StartSqlServerEW.aspx?df=100&forumid=321708&exp=0&select=1584032

    But they are using sql Anywhere.  We are using sql Server Compact Edition.  What is the difference? I can add that dll when i go to Add Reference, but then I get an error saying that it can't load the module sqlceme30.dll.  Can I just add all of those dll's to my project folder?  Is that the easiest way?

    Jeff
    Thursday, December 13, 2007 5:16 PM
  • Hi,

     

    SQL Server everywhere was the intiall name of SQL Server Compact Edition. If you installed correctly sql server compact edition 3.1 in your machine you would'n have  problems insteed.

     

    About sqlceme30.dll exception, try installing sql server compact edition in the device.. you'll find cabs at C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0\wce500.

     

    best regards,,,

    Thursday, December 13, 2007 11:43 PM
  • Sorry, I didn't mention that I was getting that error about not finding the sqlceme30.dll module when I ran the program on the machine.  So what I did was add all the necessary dll's directly to the project folder.

    Note:  This is a standalone desktop project used only to convert the .sdf file to .mdb or .xls.  Just wanted to make sure that was clear.

    However now when I run the program, I'm getting a new error:
    System.BadImageformatException: An attempt was made to load a program with an incorrect format.  (Exception from HRESULT: 0x8007000B)
      at System.Data.SqlServerCe.NativeMethods.DllAddRef().....and so on...

    Anyone know why it is doing this?  It is happening on the line where I connect to the database.

    Jeff
    Monday, December 17, 2007 2:29 PM
  • Same problem here. Have you solved it?
    Tuesday, August 05, 2008 3:20 PM
  •  

    Same here. Any answers? Why is this dll required when only the .sdf file is used on the device.
    Friday, October 03, 2008 9:14 PM