Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error deleting the replication!!

Status
Not open for further replies.

nowayout

Programmer
Feb 25, 2003
364
US
Hi all,

I am trying to delete the replication but it gives me error saying that :

SQL Server EM could not retrieve information about publication 'database_name'

errot 21776: [SQL-DMO] the name "name" was not foundin transpublication collection. if the name is qualified name use[] to separate various part of the name and try again.

any suggestion? please

 
That is probably because you have deleted it already. Give it some time to refresh.
 
it's been two weeks but there is no publication but on it but the under it shows the error icon on one of the replication.

 
what can i do with this situation please.

give me some suggestion.

thanks
 
I'm dealing with the same problem.

I've been looking around, but can't find an easy answer, most of the Error 21776 are associated with restoring the master db and not having the sa account correctly associated with a corresponding database.

I think we might be able to delete the publication directly from the distribution table?

EyeT
 
Try recreating the whole replication if that is possible. This doesn't seem to be a bad option.
 
Hello All,
This is a new post but I am getting some exception which is similar to your error.
I am using the SQL DMO COM Library with VB.NET for implementing replication between three db servers programmatically. I am trying to implement merge replication where data in one will be pushed into the other two. I used the sample application provided in SQLREPL to implement this.
The following is the code for adding a Registered Subscriber to the collection.

objRegSubscriber = New RegisteredSubscriber
objRegSubscriber.Name = lstTransServers.Items(intIndex).ToString
objRegSubscriber.Type = SQLDMO_SUBSCRIBER_TYPE.SQLDMOSubInfo_SQLServer

'Add the subscriber to the Publishers' collection
'###############EXCEPTION THROWN##########
objPublisher.RegisteredSubscribers.Add(objRegSubscriber)

I wrote this code in the morning and tested it. The code worked fine. But later there were some modifications done in the publisher Server, after which the following exception occured :
"[SQL-DMO]This property or method is not available until the object (or its parent if appropriate) has been added to a collection."

Could someone please explain the reason for this ? I would be really really thankful.

Prakash.
 
there might be some changes in database table structure which you are trying to replicate try to change and then reassigned that replication it might work!!
 
Its been four days... the problem still persists man! I am sick of it. How much time is needed to refresh ? I will post my code so that you tell me if something is wrong there (i got this code from the SQL replication sample provided by Microsoft when we install SQL Server 2000)

Private Function CreatePublisher() As Boolean
Dim objSQLServer As SQLServer2
Dim objPublisher As DistributionPublisher2
Dim objRegSubscriber As RegisteredSubscriber

Dim intIndex As Integer

Try
'Getting the connection string from Access database
m_dtMaster = GetDataSet("SELECT * FROM tbl_Master_Servers_Info WHERE Master_Server_ID = '" & cboMasterServer.SelectedItem.ToString & "'", _
"tbl_Master_Servers_Info", , , False, m_strMDBConnStr).Tables(0)

m_strMasterConnStr = m_dtMaster.Rows(0)("Connection_String").ToString

m_strMasterServerName = m_strMasterConnStr.Split(";".ToCharArray)(0).Split("=".ToCharArray)(1)
m_strMasterDatabase = m_strMasterConnStr.Split(";".ToCharArray)(1).Split("=".ToCharArray)(1)
m_strMasterUserID = m_strMasterConnStr.Split(";".ToCharArray)(2).Split("=".ToCharArray)(1)
m_strMasterPassword = m_strMasterConnStr.Split(";".ToCharArray)(3).Split("=".ToCharArray)(1)

'Get the SQL Server that will be acting as Master (Publisher)
objSQLServer = New SQLDMO.SQLServer2
'Connect to SQL Server Distributor
objSQLServer.Connect(m_strMasterServerName, m_strMasterUserID, m_strMasterPassword)

'Get the drive and dir info
m_strMasterWorkingDir = objSQLServer.Registry.SQLRootPath & "\repldata"

'Create Distribution Publisher
objPublisher = New DistributionPublisher2
objPublisher.Name = "SAMPLE"
objPublisher.DistributionDatabase = "distribution" 'Distribution Database Name
objPublisher.ThirdParty = True
'objPublisher.DistributionWorkingDirectory = m_strMasterWorkingDir

Dim ddb As DistributionDatabase
ddb = New DistributionDatabase
ddb.Name = "distribution"
objSQLServer.Replication.Distributor.DistributionDatabases.Add(ddb)
'Add the Distribution Publisher to the SQL Server's Replication collection
objSQLServer.Replication.Distributor.DistributionPublishers.Add(objPublisher)
'objSQLServer.Replication.Distributor.DistributionPublishers.Item(1).Refresh()

'Create Subscribers
For intIndex = 0 To lstTransServers.Items.Count - 1
objRegSubscriber = New RegisteredSubscriber
objRegSubscriber.Name = lstTransServers.Items(intIndex).ToString
objRegSubscriber.Type = SQLDMO_SUBSCRIBER_TYPE.SQLDMOSubInfo_SQLServer

'Add the subscriber to the Publishers' collection
'###The line of error ###

objPublisher.RegisteredSubscribers.Add(objRegSubscriber)

'###The line of error ###

objRegSubscriber = Nothing
Next

objSQLServer.Close()
Return True

Catch ex As Exception
objPublisher = Nothing
objRegSubscriber = Nothing
objSQLServer.Close()
Return False
Finally
objPublisher = Nothing
objRegSubscriber = Nothing
objSQLServer = Nothing
End Try
End Function


Kindly tell me whether the code has something to do with the error.

Prakash.
 
Hey Prakash,

Sorry for late response but I am not that aware of how to do replication from access to SQL but the code you written is look fine to me but also one thing that i can suggest that if you are doing replicatoin from Access to SQL, would do DTS instead that will work faster.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top