Wednesday, March 28, 2012

NEED HELP - Merge Replication with SQL Server 2000

Hi, I posted about this before, and set out on my own to get this working, and haven't been able to. I'm trying to get merge replication working with my SQL server 2000, and after 2 weeks I still have nothing. I've gone through multiple 'walkthroughs' which all brought me to the same point. I'm getting down to crunch time, and I'm either going to use this or implement my own merge algorigthm (I'd much rather use this). So here's where I've gotten to:
My database it taking snapshots correctly (i think)
I believe IIS is configured correctly, because I am able to get to the dll in the snapshot folder
I have tried using two different DLL's, sqlcesa30.dll and sscesa20.dll. Here are the corresponding error messages I get:
sscesa20.dll : Header information is either corrupted or missing.
sqlcesa30.dll : Initializing SQL Server Reconciler has failed.
and from the sqlcesa30.dll log: 'Publication 'replicatePub' does not exist. -2147201022
Here is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlServerCe;
namespace mergetest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
// Create a new instance of the SqlCeReplication class
SqlCeReplication rep = new SqlCeReplication();
rep.InternetUrl = @."http://10.0.64.135/replicate/sqlcesa30.dll"; // InternetURL
rep.Publisher = @."LUKETEST"; // Publisher
rep.PublisherDatabase = "replicate"; // PublisherDatabase
rep.PublisherSecurityMode = SecurityType.NTAuthentication;
rep.Publication = "replicatePub"; // Publication
rep.Subscriber = "mobile"; // Subscriber
rep.SubscriberConnectionString = @." Data Source=\My Documents\PubsMR.sdf"; // ConnectionString

try
{
// Check if the database file already exists
if (!System.IO.File.Exists(@."\My Documents\PubsMR.sdf"))
{
// Add a new subscripton and create the local database file
rep.AddSubscription(AddOption.CreateDatabase);
}
// Transfer the initial snapshot of data if this is the first
// time is this called. Subsequent calls will transfer only the
// changes to the data
rep.Synchronize();
}
catch (SqlCeException ex)
{
// Display any errors in a message box
MessageBox.Show(ex.Message);
}
finally
{
// Dispose of the SqlCeReplication object, but don’t drop the
// subscription
rep.Dispose();
// Notify the user that merge replication is complete
MessageBox.Show("Replication complete");
}
}
private void butGo_Click(object sender, EventArgs e)
{
}
}
}
I am also happy to pay for support in this matter. can you guys recommend where I would call at microsoft to get a helpful person? thanks.
|||I finally got it working! To people having trouble setting this up, I recommend using the sqlcesa30.dll (sql ce v3.0), as it gives MUCH more helpful error messages.
|||We are extremely sorry that we have not picked up your question and have not answered.

From next time on, please try out SQL Server and Merge Replication questions in other forum "SQL Server Replication" too (apart from this forum).

Thanks,
Laxmi NRO, MSFT, SQL Mobile

No comments:

Post a Comment