Saturday, February 25, 2012

Problem Creating a subscription

I am trying to publish / subscribe a database onto SQL Server Mobile and when I run the following code that was, for the most part, generated by the SQL Server Management Studio Subscription Wizard,

repl.InternetUrl=@."file://chiefjoseph/walklisttransfersite/sqlcesa30.dll";

repl.InternetLogin = @."rr";

repl.InternetPassword = @."88";

repl.Publisher = @."CHIEFJOSEPH\SQLSERVER2005";

repl.PublisherDatabase = @."WalkList";

repl.PublisherSecurityMode = SecurityType.DBAuthentication;

repl.PublisherLogin = @."sx";

repl.PublisherPassword = @."xxx";

repl.Publication = @."WalkList";

repl.Subscriber = @."WalkListSubscription";

repl.SubscriberConnectionString = @."Data Source=""\My Documents\SQLServer\NewWalkList.sdf"";Password=""pwd"";Max Database Size=32;Default Lock Escalation =100;";

try

{

// repl.AddSubscription(AddOption.ExistingDatabase);

repl.AddSubscription(AddOption.ExistingDatabase);

repl.Synchronize();

}

catch (SqlCeException ex)

{

MessageBox.Show(ex.ToString());

}

I get the following error on the Pocket PC emulator

“A native exception has occurred in WalkLister.exe.Select Quit and then restart this program, or select Details for more information.”

When I try to use the subscription wizard to create the subscription, I get the following error:

Synchronizing Data (Error)

Messages

· Connection broken.
HRESULT 0x80004005 (0)

· The operation could not be completed.

Any insight to what the problem might be?

-Rob

I see a couple of odd things in your replication properties -

1. repl.InternetUrl=@.file://chiefjoseph/walklisttransfersite/sqlcesa30.dll

should be repl.InternetUrl = "http://chiefjoseph/walklisttransfersite/sqlcesa30.dll ";

2. the subscriber connection string should be

repl.SubscriberConnectionString = @."Data Source='\My Documents\SQLServer\NewWalkList.sdf';Password='pwd';Max Database Size=32;Default Lock Escalation =100";

I would recommend you start by using anonymous authentication (be sure to grant account IUSR_chiefjoseph permissions on your publication and the Walklist database if you do so) and then add SSL later. NT and DB authentication are a poor choice for merge replication because the userid and password are sent in the clear to the server.

-Darren

No comments:

Post a Comment