0

I'm aware that in Fox Pro that when creating an index the indexes are stored in files with the same name as the (.dbf) table and a different extension such as .cdx or .idx.

That said how does one programmatically determine what fields of a table are indexed?

P.S. I'm trying to run queries on a third party product that uses Fox Pro, I don't have a copy of Visual Fox Pro to use, but I do have ODBC and SQuirreL SQL. The queries are going really slow, and that's why I ask about the indexes.

leeand00
  • 25,510
  • 39
  • 140
  • 297

1 Answers1

4

Use the ATagInfo() function. It fills an array with a list of index tags for the table. Note that only open indexes are included, so if you're using anything other than the structural CDX (the one with the same name as the table), you have to make sure to open the other indexes before using ATagInfo().

(Using anything other than the structural index file is deprecated, but if you're dealing with an old enough product, you might find them.)

Tamar

Tamar E. Granor
  • 3,817
  • 1
  • 21
  • 29
  • Can I run functions through ODBC? I don't know...that's why I'm asking...cause I don't think I have a Fox Pro client. – leeand00 Sep 01 '12 at 00:03
  • If you have access to the CDX files themselves but not the VFP software, you can try directly examining the .CDX files. The structure is here: http://msdn.microsoft.com/en-us/library/k35b9hs2%28v=vs.71%29.aspx and I'd recommend something like V from http://www.fileviewer.com to do the actual viewing. (This assumes you're comfortable looking at file structures in hex). – LAK Sep 04 '12 at 17:20