Get SupportDownload SoftwareGo ShoppingContact Us
Log-In Log-Out
 














 
Last Updated
 
Course Home Download NLM.exe 96KB

Changing An Object Name

void ModifyObjectName(NWDSContextHandle con)
{
	 int x;
	 NWDSCCODE	 cCode;
	 
	 if(dontCreate != 1)
	 {
	 	 printf("Modifying Objects Names.\n");
	 	 for(x = 0; x < 5; x++)
	 	 {
	 	 	 if((New[x] = malloc(50)) == NULL)
	 	 	 {
	 	 	 	 printf("Memory allocation failed.\n");
	 	 	 	 ShutDownFlag = 1;
	 	 	 	 break;
	 	 	 }
	 	 	 else
	 	 	 {
	 	 	 	 switch(x)
	 	 	 	 	 {
	 	 	 	 	 case 0:	 strcpy(New[x], "test");
	 	 	 	 	 	 	 break;
	 	 	 	 	 case 1:	 strcpy(New[x], "test2");
	 	 	 	 	 	 	 break;
	 	 	 	 	 case 2:	 strcpy(New[x], "test3");
	 	 	 	 	 	 	 break;
	 	 	 	 	 case 3:	 strcpy(New[x], "test4");
	 	 	 	 	 	 	 break;
	 	 	 	 	 case 4:	 strcpy(New[x], "test5");
	 	 	 	 	 	 	 break;
	 	 	 	 	 }
	 	 	 	 strcat(New[x], ".");
	 	 	 	 strcat(New[x], strObjectContext);
	 	 	 	 if((cCode = NWDSModifyRDN(con, Names[x], New[x], 1)) != 0)
	 	 	 	 {
	 	 	 	 	 printf("Change object name failed:%d\n", cCode);
	 	 	 	 }
	 	 	 	 else
	 	 	 	 {
	 	 	 	 	 printf("%s changed to %s.\n", Names[x], New[x]);
	 	 	 	 }
	 	 	 }
	 	 }
	 }
}

NWDSModifyRDN is used to change the relative distinguished name of an object in NDS. The first three paramaters are context, old object name, and new object name. The last parameter is typically set to TRUE. Setting this parameter to TRUE will delete all attribute values of the object, including the name.


Last updated on:

Course Home Download NLM.exe 96KB