0

In our application we are planning to use SQL Server CE 4.0 using OLE DB. The connection string is shown below.

Dim strConn As String = "Provider=Microsoft.SQLSERVER.CE.OLEDB.4.0;Data Source=\\pc137\d\desktop\mydb.sdf; SSCE:Database Password='password';"
Dim conn As New OleDbConnection            
conn = New OleDbConnection(strConn)            
conn.Open() 

This one worked for both the local and network share files (.sdf)

We tried to connect using Visual Studio for the network share we get following error

SQL Server Compact does not support opening database files on a network share.

We have referred this links

So is it allowed to connect SQL Server CE 4.0 using OLE DB in network share?

Does it cause any other problem?

  • 1
    The error message and link seem pretty clear that it isn't supported. Why not utilize SQL Express? – LowlyDBA Dec 17 '14 at 14:47
2

No, this is not supported. And using the Oledb provider from a .net application is not supported either, use the Ado.net provider (System.Data.SqlServerCe)

  • But using OLE DB as shown in original post we are able to connect to database in a network share. So how it worked ? – IT researcher Dec 18 '14 at 6:04
  • That you can connect does not mean that it is supported, and you will run into issues with for example parameters and image columns – ErikEJ Dec 18 '14 at 6:59
  • Can you please explain what problem occurs related to image columns. Also which parameters do you mean? – IT researcher Dec 18 '14 at 9:07
  • Image/ntext columns cannot be selected via the OLEDB provider, and parameterized SQL does not work as expected – ErikEJ Dec 18 '14 at 12:22
  • 1
    No you cannot, it is not supported, use SQL Server Express instead – ErikEJ Dec 19 '14 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.