Connect to SQL Server Compact Edition with OLE DB

  • Beautiful day!

    I would like to ask somebody to help me.

    I have the following problem:

    I have a Windows Mobile Device with SQL Server Compact Edition 3.5 and an sdf file in Program Files. I also have a desktop PC with SQL Server 2008. I would like to make an application not with .NET framework. I should connect to the sdf file with OLE DB. I set the connection string as follows:

    Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=Mobile Device\Program Files\database.sdf;pwd=pwd

    I tried it with OLE DB in CodeGear RAD Studio and in Visual Studio too. In both environment I got the following exception at Open function:

    Multiple-step OLE DB operation generated errors...

    What can I do? If I try to connect a local sdf file on desktop pc I get the same message.

    Please somebody help me!

  • The installation of MSSQL CE is incomplete!

    You should add the following registry key:

    [HKEY_CLASSES_ROOT\CLSID\{F49C559D-E9E5-467C-8C18-3326AAE4EBCC}\OLE DB

    Provider]

    @="Microsoft SQL Server Compact OLE DB Provider"

    That's all! Thanks for Microsoft.

  • I created the key and restarted the pc but it didn't solve my problem.

  • change connection string to SSCE[:]Database Password='myPassword' instead of pwd (no [] around : )

  • Hey,

    do you get the exception while connecting or wile requesting a query?

    I had the same problem with a query like "SELECT TOP 1 ...". SQL Server COmpact doesn't understand that. i had to use "SELECT TOP (1)...".

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply