November 2, 2007 at 11:13 pm
I'm not really sure how else to explain this, so I'm just going to describe what steps I am taking to set everything up. I have code written in VB.Net that successfully sets up a Publisher on the server side, and successfully sets up a Subscriber on the client side. No errors arise from either of these steps, and I can see the publications/subscriptions in SQL Server manager. However, when I try to start the synchronization, I am getting an error message "The publication "%" does not exist." I've tried researching this topic, but the only results refer to people trying to remove replication settings. I found one that suggested to run the following script to take a look at one of the replication tables:
use distribution
go
select * from MSmerge_publications
go
Only problem is, the MSmerge_publications table does not exist in my distribution database! I am wondering when this table gets created, and what settings might possibly disable its creation. I don't really understand what I could have changed to prevent this table from initializing, because it used to work earlier this week. I am including some sample source code below, to show my steps in setting up the publisher. Please help!
Chris
***** Source Code Below *****
'Please note, not all code is included.
'I'm just pasting the stored procedures I am calling, with the
'parameters defined. Please let me know if more info is needed.
Dim params333() As SqlParameter = {New SqlParameter("@publication", SqlDbType.VarChar)}
'params333(0).Value = "FP_Publication"
dataAcessLayer.clsExecuteSP("sp_helpmergepublication", params333, dsDistri)
Dim Params() As SqlParameter = {New SqlParameter("@distributor", SqlDbType.VarChar)}
Params(0).Value = publisher
dataAcessLayer.clsExecuteSP("sp_adddistributor", Params)
Dim Params1() As SqlParameter = {New SqlParameter("@database", SqlDbType.VarChar)}
Params1(0).Value = "distribution2"
dataAcessLayer.clsExecuteSP("sp_adddistributiondb", Params1)
'add publisher code
Dim Params2() As SqlParameter = {New SqlParameter("@publisher", SqlDbType.VarChar), _
New SqlParameter("@distribution_db", SqlDbType.VarChar), _
New SqlParameter("@working_directory", SqlDbType.VarChar), _
New SqlParameter("@security_mode", SqlDbType.Int)}
Params2(0).Value = publisher
Params2(1).Value = "distribution2"
Params2(2).Value = "\\" + publisher + "\ReplData"
Params2(3).Value = 1
dataAcessLayer.clsExecuteSP("sp_adddistpublisher", Params2)
'set the db for publication
Dim Params3() As SqlParameter = {New SqlParameter("@dbname", SqlDbType.VarChar), _
New SqlParameter("@optname", SqlDbType.VarChar), _
New SqlParameter("@value", SqlDbType.VarChar)}
Params3(0).Value = "SAMPLE"
Params3(1).Value = "merge publish"
Params3(2).Value = "true"
dataAcessLayer.clsExecuteSP("sp_replicationdboption", Params3)
'create a publication database
Dim Params4() As SqlParameter = {New SqlParameter("@publication", SqlDbType.VarChar), _
New SqlParameter("@retention", SqlDbType.Int), _
New SqlParameter("@snapshot_in_defaultfolder", SqlDbType.NChar), _
New SqlParameter("@alt_snapshot_folder", SqlDbType.VarChar), _
New SqlParameter("@compress_snapshot", SqlDbType.NChar)}
Params4(0).Value = "FP_Publication"
Params4(1).Value = 0
Params4(2).Value = "False"
Params4(3).Value = "\\" & GetPublisher(publisher) & "\ReplicationData\ReplData\"
Params4(4).Value = "True"
dataAcessLayer.clsExecuteSP("sp_addmergepublication", Params4)
'create publication snapshot
Dim Params5() As SqlParameter = {New SqlParameter("@publication", SqlDbType.VarChar), _
New SqlParameter("@frequency_type", SqlDbType.Int), _
New SqlParameter("@frequency_interval", SqlDbType.Int), _
New SqlParameter("@frequency_subday", SqlDbType.Int), _
New SqlParameter("@frequency_subday_interval", SqlDbType.Int), _
New SqlParameter("@frequency_relative_interval", SqlDbType.Int), _
New SqlParameter("@frequency_recurrence_factor", SqlDbType.Int), _
New SqlParameter("@active_start_date", SqlDbType.Int), _
New SqlParameter("@active_end_date", SqlDbType.Int), _
New SqlParameter("@active_start_time_of_day", SqlDbType.Int), _
New SqlParameter("@active_end_time_of_day", SqlDbType.Int)}
Params5(0).Value = "FP_Publication" 'publication
Params5(1).Value = 4 'frequency_type
Params5(2).Value = 1 'frequency_interval
Params5(3).Value = 1 'frequency_subday
Params5(4).Value = 0 'frequency_subday_interval
Params5(5).Value = 0 'frequency_relative_interval
Params5(6).Value = 1 'frequency_recurrence_factor
Params5(7).Value = 0 'active_start_date
Params5(8).Value = 0 'active_end_date
Params5(9).Value = 10000 'active_start_time_of_day
Params5(10).Value = 235959 'active_end_time_of_day
dataAcessLayer.clsExecuteSP("sp_addpublication_snapshot", Params5)
'start adding articles to database (omitted)
'etc…
November 3, 2007 at 11:51 am
I think I realize now that my issue is either msde2000 specific, or I have a corrupted database, as I just tested this with a sql2005 publisher, and everything was successful. I will still take input though! Almost anything I hear from this will be valuable to me. Thank you.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply