*FUNCTION RemCDX( pcFile ) LPARAMETERS pcFile LOCAL lnHandle, laJnk[1], lcFlags, oErr, lnRes, lcType, lnHdrLen, lcHdrLen PRIVATE nErr nErr = 0 lnRes = 0 if adir(laJnk,pcFile)=0 RETURN -1 endif lnFileSize = laJnk[2] lnHandle = THIS.LLFF.FOPEN(pcFile,12) && Open file, R/W, Unbuffered IF lnHandle <= 0 RETURN iif(lnHandle=0,-1,lnHandle) ENDIF oErr = On("ERROR") ON ERROR nErr=Error() lcType = THIS.LLFF.FREAD(1) if ASC(lcType)<>0x30 && Visual Foxpro THIS.LLFF.FCLOSE ON ERROR &oErr RETURN 0 endif * Find start of DBC name THIS.LLFF.FSEEK(8,0) && First Record Pointer lcHdrLen = THIS.LLFF.FREAD(2) lnHdrLen = ASC(lcHdrLen) + ASC(SubStr(lcHdrLen,2))*256 * Clear out DBC name THIS.LLFF.FSEEK(lnHdrLen-263,0) THIS.LLFF.FWRITE( REPL(chr(0),263) ) THIS.LLFF.FCLOSE ON ERROR &oErr RETURN lnRes>I want to drop and recreate tags some of which are Primary and Candidate. Does anybody know of code that can do this without losing things in the DBC?