SQL Server 2022 Replication RMO Syncing No Interface Supported

ou6hu8tu  于 2023-03-17  发布在  SQL Server
关注(0)|答案(1)|浏览(129)

I'm trying to get SQL Server 2022 setup to use merge pull replication. Topography has the publisher/distributor on the same server, with a second server running IIS for clients to connect to. Client machines are running SQL Server 2022 Express. All machines are running SQL Server 2022 - v16.0.4003.

The client machines run a small application that handles syncing, using the RMO library. I've included the code snippet below.

When I configure the agent object to use Web Sync, it throws an error
0x80004002: No such interface supported.

I can remove these settings, and syncing will attempt to run. However, it won't use web syncing.

Using the replmerg console application, web syncing will function correctly. Based on this, I'm assuming that the server configuration is correct.

In the below snipped, I've added in a bunch of error trapping, none of which shows anything more detailed than the no such interface supported. Agent.Output is blank, agent.ComErrorCollection is empty.

Any ideas would be appreciated

ServerConnection conn = new Microsoft.SqlServer.Management.Common.ServerConnection(settings.SubscriberName);
MergePullSubscription subscription = new MergePullSubscription();
MergeSynchronizationAgent agent;

conn.Connect();

subscription.ConnectionContext = conn;
subscription.DatabaseName = settings.LocalDBName;
subscription.PublisherName = settings.PublisherName;
subscription.PublicationDBName = settings.PublicationDBName;
subscription.PublicationName = settings.PublicationName;

if (subscription.LoadProperties())
{

    agent = subscription.SynchronizationAgent;
    agent.Distributor = settings.PublisherName;
    agent.DistributorSecurityMode = Microsoft.SqlServer.Replication.SecurityMode.Integrated;
    agent.PublisherSecurityMode = Microsoft.SqlServer.Replication.SecurityMode.Integrated;
    agent.HostName = Environment.MachineName;
    agent.SubscriptionType = SubscriptionOption.Pull;
    agent.ExchangeType = MergeExchangeType.Bidirectional;

    agent.DownloadGenerationsPerBatch = 200;
    agent.UploadGenerationsPerBatch = 200;
    agent.InternetTimeout = settings.TimeoutSeconds;
    agent.OutputVerboseLevel = 2;

    agent.UseWebSynchronization = true;
    agent.InternetSecurityMode = SecurityMode.Standard;
    agent.InternetUrl = settings.ReplicationURL;
    agent.InternetLogin = settings.ReplicationUsername;
    agent.InternetPassword = settings.ReplicationPassword;

    try
    {
        agent.Synchronize();
    }
    catch (Exception ex)
    {
        foreach (ComErrorRecord comError in agent.ComErrorCollection)
        {
            log.Debug($"Com Error: {comError.ErrorNumber}: {comError.Description}");
        }
        log.Debug("Agent Output: " + agent.Output);
        log.Error("Error in Syncronize (" + settings.SubscriberName + "): " + ex.Message);
        EmailLog.Error("Error in Syncronize (" + settings.SubscriberName + "): " + ex.Message);
    } 
}
ccrfmcuu

ccrfmcuu1#

The error "0x80004002: No such interface supported" is a COM error that can occur when there is a compatibility issue between the version of the SQL Server RMO library being used and the version of SQL Server installed on the server.

In this case, since you are using SQL Server 2022, you may need to update your RMO library to the latest version to ensure compatibility. You can download the latest version of the RMO library from the Microsoft Download Center.

Additionally, you may want to verify that the necessary SQL Server replication components are installed on the client machines running SQL Server 2022 Express, as they may be required for successful synchronization using merge pull replication with web synchronization.

If updating the RMO library and ensuring the necessary replication components are installed does not resolve the issue, you may want to try using a different method of synchronization, such as file-based or FTP-based synchronization, to see if that works.

相关问题