Function : Database

NSFDbLocateByReplicaID - Locate a database by replica ID.
----------------------------------------------------------------------------------------------------------

#include <nsfdb.h>

STATUS LNPUBLIC NSFDbLocateByReplicaID(
DBHANDLE hDB,
DBID far *ReplicaID,
char far *retPathName,
WORD PathMaxLen);

Description :

This function takes a database handle (DBHANDLE) to the data directory, or to one of its subdirectories, and the replica ID of a database. It returns an expanded path specification for the replica. The function searches all subdirectories of the data directory for the database.

Note: If you are trying to locate a replica on a remote Lotus Domino Server, obtain the replica ID of the local database replica with NSFDbReplicaInfoGet, build a fully qualified network pathname to the remote server's data directory with OSPathNetConstruct, use that path with NSFDbOpen to obtain a handle to the data directory, and then pass that handle to NSFDbLocateByReplicaID to get the server's pathname for the replica you want. The network path to that database may then be constructed using OSPathNetConstruct.

Parameters :

Sample Usage :

 
       if (error_status = NSFDbOpen(src_datadir, &db_handle_dir))
           goto Exit;

       cleanup_state += CLOSE_DIR_DB;

       if (error_status = NSFDbLocateByReplicaID(db_handle_dir,
                            &replica_info_dst.ID, path_by_replid,
                            sizeof(path_by_replid)-1))
       {
           if(ERR(error_status) != ERR_NOEXIST)
               goto Exit;
       }
       else
       {
           printf("\nGiven: %s Matched with: %s by Replica ID\n",
                  dst_expandedpath, path_by_replid);
           printf("Note- Match path is relative to Notes Data\n");
           printf("Directory, NOT to the directory supplied.\n");
       }
       cleanup_state -= CLOSE_DIR_DB;
       if (error_status = NSFDbClose(db_handle_dir))
           goto Exit;

   }


See Also :

NSFDbPathGet
----------------------------------------------------------------------------------------------------------