Linking FoxPro tables with .cdx files

G

Guest

I am linking a FoxPro table into an Access database, running an append query
to update the FoxPro table then exporting the FoxPro table back to its
original program where the data will be used. The problem I am having is
that each time I send the FoxPro table back to where it belongs, the .cdx
file isn't updating and I have to do this manually.

Is there a way that Access can update the .cdx file without manually doing
this each time.

Thanks in advance
Sandy
 
C

Cindy Winegarden

HI Sandy,

You're linking to a Fox table and appending data to it. Why then do you need
to "export" the data? Just appending records to the table, via the append
query should take care of the situation.

The Fox data engine takes care of updating the indexes automatically when
data changes. How do you know the index isn't being updated appropriately?
Depending on the indexes on the table and how you change the data the CDX
might not necessarily show a different time (in Explorer) after your append
query.

What do you mean when you say you have to update the CDX file manually?
Exactly what steps do you perform to do this?

All of this sounds more like you're using a table with the older IDX files
(individual indexes) than a CDX (compound index file).
 
G

Guest

Hi Cindy
Thanks for the reply. This situation is a bit complicated but I'll try to
explain.

My client has a database that runs in several locations (non-networked).
The master is located in the office and stores lots of information. The
other locations only write information to one table but they need information
sent to them from the master to enable them to do this. The original system
was a FoxPro database coupled with custom hardware that cannot be easily
replaced. For this reason, we have left the original database in place at
the other locations but replaced the Master database with MS Access 2003.

So, each week, the linked .dbf files (linked from local hard drive) are
updated via Access update/append queries and then sent down to the other
locations. Most of this works fine, but there is one table that has a .cdx
index file associated with it. The information from this particular table is
not visible at the other locations until I manually reindex the .cdx file and
send this down as well. I use a simple shareware program to do this but it
isn't practical to do this every time the data is transferred.

I remember that earlier version of Access used to allow you to select the
associated Index file but later versions don't. Do you know of a work around
for this situation.

I hope I explained it properly.

Sandy
 
C

Cindy Winegarden

Hi Sandy,

I assume you're sending out the new CDX files that go with the DBFs in
question.

Do you know what the index expressions are? Can you give me an idea of what
the data types of the fields in the index expressions are?

There is an index like "INDEX ON SomeField Tag MyTag UNIQUE" that is rather
misleading in that it doesn't require unique values but rather hides any
rows that duplicate the value in question.

The older version of Access that let you choose an index was probably set up
to use the IDX style indexes which didn't update automatically unless you
used "SET INDEX TO MyIndex.idx".
 
G

Guest

Hi Cindy
I will check the index expressions tomorrow morning and reply with my
findings. Thanks for your replies.

Sandy
 
G

Guest

Hi Cindy
Hope you are still watching this post. It took me a while to find the index
expressions as I don't have FoxPro.

I think that this is it:

IndexName: jobdetl
TagName: JD_ID
Descending: F
For Condition Exists: F

Not sure what all this means.

Sandy
 
C

Cindy Winegarden

Hi Sandy,

Just to make sure, are your Fox tables linked directly or via an ODBC data
source? Does it make a difference if you use ODBC rather than linking
directly? (The latest FoxPro and Visual FoxPro ODBC drivers are downloadable
from msdn.microsoft.com/vfoxpro/downloads/updates .)

When you send out new files, I'm assuming you send out the CDX and DBF
together (along with an FPT if it's present).

When you add data to the tables via your append query, does the Windows time
on the CDX file change?

I'm still pretty mystified because the indexing requirement you describe
sounds like what happens with IDX indexes and not CDX indexes.
 
G

Guest

Hi Cindy
Excuse my ignorance but I am using Windows XP and as far as I can tell,
there is no FoxPro ODBC driver available for XP. Happy to be corrected if I
have this all wrong. I am linking directly and when I append data to the
FoxPro tables, the .cdx file date/time does not update. It is definately a
..cdx file. The problem is driving me mad because every time my client sends
his data to the remote locations, I have to quickly reindex the .cdx and
remote the file over via PCAnywhere.

In desperation, I deleted the index from the .dbf file and then removed the
..cdx file from the folder in the hopes that the FoxPro program wouldn't care,
but alas, it fell over so I had to restore the index.

Sandy
 
C

Cindy Winegarden

Hi Sandy,

The Fox ODBC drivers don't come with XP, you have to download and install
them separately from the address below. You may have a corrupt index file.
Any chance you can send me (part of) the Fox table and a stripped down copy
of your MDB ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top