Bayron
I have never used the TEMP option .. I kinda like to know where my files are being created, their names either .idx or .cdx.
Please consider this code ..
// this needs to be in your main.prg
REQUEST DBFCDX
rddsetdefault( "DBFCDX" )
Local FundDbf,dbf_stru
// create a temp file name off the root of the Default Folder
xVol := set(7)
DO WHILE .T.
  FundDbf := "TEMP"+(SUBSTR(TIME(),7,2)+SUBSTR(TIME(),4,2))+".DBF"
  IF .not. FILE( xVOL+"\DBTMP\"+FUNDDBF )
   EXIT
  ENDIF
ENDDO
DBF_STRU := { }
AADD( DBF_STRU, { "DESC", Â Â "C", Â 40, 0 } )
AADD( DBF_STRU, { "AMOUNT", Â "N", Â 8, Â 2 } )
AADD( DBF_STRU, { "FUNDED", Â "N", Â 8, Â 2 } )
AADD( DBF_STRU, { "BOX", Â Â Â "N", Â 2, Â 0 } )
AADD( DBF_STRU, { "CLASCODE", "C", Â 10, 0 } )
DBCREATE( xVOL+"\DBTMP\"+FUNDDBF, DBF_STRU )
SELECT 9
Use ( xVOL+"\DBTMP\"+FUNDDBF ) via "DBFCDX" EXCL
   Index on ClasCode Tag ClasCode     // creates .cdx of the same database name
ELSE
  CLose Databases
  RETURN(.F.)
ENDIF
..
do your own data processing here
..
Close Databases
Ferase( "Tempxxxx.Dbf" )
Ferase( "Tempxxxx.Cdx" )
Note that if you use .cdx the name of the file is created for you ( same name as the .dbf) with a .cdx extention. If you use .Idx .. you have to create a separate index name for each index .. .cdx is the way to go because you can build multiple ( tags ) indexes into the same .cdx.
Rick Lipkin