Replication Error:28557

K

Kai

I use SQLCE Help Book's code to test Replication, but I
always get the error:28557(The SQL Server CE database
cannot be used for replication. Delete and then re-create
the database.)
Error Code:80004005
Message:Run
Minor Err.:28557
Source:SQLCE
Err. PAr. :data sorce=\program\Nwind\ssce.sdf;


=========Source Code=========
Public Sub CreateReplDB()
Dim repl As SqlCeReplication = Nothing
If File.Exists("\Program Files\Nwind\ssce.sdf") Then
File.Delete("\Program Files\Nwind\ssce.sdf")
End If

Try
repl = New SqlCeReplication
repl.InternetUrl
= "http://IISServer/nwind_sqlce/sscesa20.dll"
repl.InternetLogin = [String].Empty
repl.InternetPassword = [String].Empty
repl.Publisher = "DBServer"
repl.PublisherDatabase = "Northwind"
repl.PublisherLogin = "sa"
repl.PublisherPassword = "123"
repl.Publication = "NWind"
''**********Error Line*****************************
repl.SubscriberConnectionString = "Data Source=\Program
Files\Nwind\ssce.sdf"
''**********Error Line*****************************
repl.Subscriber = "MyDevice"
repl.AddSubscription(AddOption.CreateDatabase)
repl.ExchangeType = ExchangeType.BiDirectional
repl.Synchronize()
MessageBox.Show("OK")
Catch ex As SqlCeException
MessageBox.Show(ex.message)
Finally
repl.Dispose()
End Try
End Sub
 
B

Brad Syputa - MS

Hi Kai,

Try using the root directory and see what happens.

repl.SubscriberConnectionString = "Data Source=ssce.sdf"
or
repl.SubscriberConnectionString =
"provider=MICROSOFT.SQLServer.OLEDB.CE.2.0;Data Source=ssce.sdf"

Should not make a difference either way, but give it a try.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top