Community
Showing results for 
Search instead for 
Do you mean 
Reply

Retrieving publisher machine name and port from subscriber (remote) database

Copper Super Contributor
Posts: 52
Country: United_Kingdom

Retrieving publisher machine name and port from subscriber (remote) database

[ Edited ]

Retrieving publisher machine name and port from subscriber (remote) database:

 

C#

 

bool isSub = oActFwk.SynchronizationManager.IsSubscriberDB;
if (isSub == true)
{
    string hostName = oActFwk.SynchronizationManager.SyncServerMachineName;
    string hostPort = oActFwk.SynchronizationManager.SyncServerPort.ToString();

    MessageBox.Show("Host: " + hostName + " | Port: " + hostPort);
}
else
{ 
MessageBox.Show("This is not a remote database.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Stop);
}

 VB.NET

 

Dim isSub As Boolean = oActFwk.SynchronizationManager.IsSubscriberDB
If isSub = True Then
Dim hostName As String = oActFwk.SynchronizationManager.SyncServerMachineName Dim hostPort As String = oActFwk.SynchronizationManager.SyncServerPort.ToString() MessageBox.Show("Host: " + hostName + " | Port: " + hostPort.ToString()) Else MessageBox.Show("This is not a remote database.", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Stop) End If

 

Kind regards,

 

 

Russell

Astute Commentator
Posts: 22
Country: United_Kingdom

Re: Retrieving publisher machine name and port from subscriber (remote) database

Thanks. That is helpful to discover that information. what it does not do though is to programmatically find the location of the rdb/pad file on the server from the remote db. I know the machine name and I know the port, but that does not give me the file path to the rdb or pad.

Please advise.

Copper Super Contributor
Posts: 52
Country: United_Kingdom

Re: Retrieving publisher machine name and port from subscriber (remote) database

Donald,

 

I went through all the properties in the SynchrinizationManager but couldn't find anything that reports the actual HDD location of the database or PAD on the server.

 

I'm not sure I'd expect this to be in the remote in the first instance since it uses the machine name and TCP port to communicate with Act! or the Network Sync service. 

 

Having said that, you seem to be able to get the location of where the RDB file was created. I'm not sure how much use this will be to you.

 

string rdbLoc = oActFwk.SynchronizationManager.SyncRDBFileLocationPref;

 

Remember that the RDB can be created anywhere and can be renamed, moved or deleted afterwards.

 

Regards,

 

 

Russell

Astute Commentator
Posts: 22
Country: United_Kingdom

Re: Retrieving publisher machine name and port from subscriber (remote) database

Thanks Russell.

Of limited use I am afraid for that very reason. Most administrators will probably delete it after they had unpacked it on the remote machine.

Its the actual location of the ADF file that would be good to be able to capture. That we we can automatically create settings based on that loaction.

Regards

Donald