Selecting ProfileName to use by the SQLMERGXLib.SQLMerge

Hi

I am trying to set the profile name for the merge agent to use during replication.

currently I am setting

.ProfileName = "High Volume Server-to-Server Profile"

But it still defualts to the defualt profile during merge.

Has anyone had any luck in setting the profile?

I know I can do it opn the server but we are imaging the computers on the lan first and then rolling them out to the client sites. Some will be only using dial up to merge changes hence the need to be able to change the profile in the Vb code calling the merge.

Cheers

Davide

[562 byte] By [DavideRinaldi] at [2008-1-19]
# 1
Hi Davide,

Is this SQL Server 2000 or SQL Server 2005?
Also could you please post your code snippet?

MaheshDudgikar at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Replication...
# 2

Hi

It is SQL 2000, the code is from VB 6.

Also I have tried creating a custom profile as well as use the standard built in profiles. The example shown below is trying to use the profile I create called xDaves

Dim mobjMerge As SQLMERGXLib.SQLMerge

On Error GoTo Error_Handler

'Create SQLMerge control.
Set mobjMerge = New SQLMERGXLib.SQLMerge

With mobjMerge
.ProfileName = "xDaves"
.DistributorAddress = pstrGetGeneralDetails("DistributorAddress")
.DistributorNetwork = TCPIP_SOCKETS
.Distributor = pstrGetGeneralDetails("Distributor")
.FTPAddress = pstrGetGeneralDetails("FTPAddress")
.FTPLogin = pstrGetGeneralDetails("FTPLogin")
.FTPPassword = pstrGetGeneralDetails("FTPPassword")

'Setup publisher
.PublisherAddress = pstrGetGeneralDetails("DistributorAddress")
.PublisherNetwork = TCPIP_SOCKETS
.Publisher = pstrGetGeneralDetails("Distributor")
.PublisherDatabase = pstrGetGeneralDetails("WorldsmartDatabase")
.Publication = pstrGetGeneralDetails("WorldsmartMasterDatabase")

'Existing sql publisher anon subs:
.Subscriber = pstrCurrentMachineName()
.SubscriberDatabase = pstrGetGeneralDetails("WorldsmartDatabase")
.SubscriberDatasourceType = SQL_SERVER
.SubscriptionType = ANONYMOUS

'distributor, publisher and subscriber use sql authentication
.DistributorSecurityMode = DB_AUTHENTICATION
.DistributorLogin = pstrGetGeneralDetails("DistributorLogin")
.DistributorPassword = pstrGetGeneralDetails("DistributorPassword")

.PublisherSecurityMode = DB_AUTHENTICATION
.PublisherLogin = pstrGetGeneralDetails("PublisherLogin")
.PublisherPassword = pstrGetGeneralDetails("PublisherPassword")

.SubscriberSecurityMode = DB_AUTHENTICATION
.SubscriberLogin = "sa"
.SubscriberPassword = ""

.ProfileName = "xDaves"

.Initialize

.Run

.Terminate

End With

Exit Sub

Error_Handler:
pUnexpectedError Err, "modDatabase.mPerformReplication"

DavideRinaldi at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Replication...
# 3
Hi Davide,

I assume that when using the High Volume Server-to-Server Profile, you would say:
.ProfileName = "High Volume Server-to-Server Profile"
This should actually work.

We will investigate this from our end and let you know our findings.

Meanwhile could you try running the merge agent from the command line and specify the profile name and see if that works? Then we will know if this is an ActiveX issue or something else.

MaheshDudgikar at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Replication...
# 4
Hi Mahesh

I did try the high volume option, I also tried a custom profile.

I will try running it from the command line and see what happens.

Thank you for your help.

Cheers

Davide

DavideRinaldi at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Replication...
# 5
Hi Davide,

Using a custom profile or any other built-in profile (other than the default one) works fine with VB code and from the Merge agent command line from our end. I am not sure, what the problem is in your code. I will veryify your code to the one we just tested. Meanwhile please test it out with the command line and let us know the result.

Thanks,
--Mahesh

MaheshDudgikar at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Replication...

SQL Server

Site Classified