Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

index file path

Status
Not open for further replies.
Sep 17, 2001
673
US
Is there a way to set where index files are created? I am opening a boreland dbf and foxpro automatically is creating a cdx file in the same directory. I would like to know if there is some command or set command that would default where cdx files are created no matter where I am opening the dbf

Regards,

Rob
 
Hi Rob,

I don't know if there is any way to set the default location. I know that you can specify a location for each individual DBF at the time that you create the index:

INDEX ON <expression> TAG <tag> ;
OF <path and filename of CDX file>

Does that help at all?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
From the help file:
A .cdx (compound) index consists of one physical file containing many index tags. Each index tag is an index order reference for the associated table.

There are two types of .cdx files: standard compound index (.cdx) and structural .cdx. A standard compound index (.cdx) may have a different name from its associated table and can reside in a different directory from its associated table. A table can have multiple compound index files. You open a compound index with the INDEX clause of USE or with SET INDEX.

A structural .cdx must have the same name as its associated table and reside in the same directory. A table can have only one structural index file. Structural .cdx files are automatically opened and updated when the associated table is opened with USE.

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
My apologies for being inquisitive but why on earth would you want index and table files to be in different places? It just sounds like extra work. You'll have to open the index file manually and you'll have the danger of getting the two files out of synch with each other.

Geoff Franklin
 
The only thing I could see is the speed. You could possibly use cache of 2 or more drives and help access time, by implementing Mike Lewis's suggestion.

Further you could define cx_IndexDir, cx_DataDir and are visible throughout the life of the program.

public cx_DataDir, cx_IndexDir

cx_DataDir = "c:\MyProj\Test"
c_IndexDir = "e:\MyIndex\Files"

use &cx_DataDir.\DbfFile

set index to &cx_IndexDir.\FirstIndexFile
* [, MoreIndexFiles]

Just an Idea

Nasib Kalsi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top