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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Key Violations when appending to FoxPro

Status
Not open for further replies.

Yoery

Technical User
Oct 23, 2002
5
0
0
US
I am attempting to append to FoxPro 2.6 files from Access XP. I am using the most current VFP driver and can link and import with no problem. However, when I export or append back to the 2.6 files, number fields, dates, and even some character fields don't append. I am getting a key violation even on fields that are not primary keys. Does anybody know how I can append from Access XP to FoxPro 2.6? Thanks
 
Yoery,
Since Access requires a primary key field in all the tables it links too, are you sure you didn't pick the wrong field? Do all the DBF's actually have a PK field defined? (Many "rookie" table designer's don't feel it's necessary in FoxPro!)

Rick
 
Dear rgbean, when I look at the design of the linked table in Access, I find that most of the fields are marked with a key. I have tried to look at the structure of the tables in FoxPro 2.6, but I am not able to see which fields are marked as a primary key. I have also tried linking the files as dBase files. I have done this in the past with Access 97 with good results. But I am not able to do this in Access XP even though the dBase drivers are built in. It asks for an associated index, even though I was able to link them in Access 97 without an .ndx.
 
Unfortunately, FoxPro free tables don't require a Primary Key (PK) field, and it has no way to even internally document it. You have to know what (if any) field can be used as a PK based on external documentation or manual examination of the data.

FP has always used .IDX or .CDX files for indexes - not .NDX which are a dBase index file type. However as you discovered Accesses linking doesn't require an index file - just an appropriate field (which you may not have!).

Rick
 
Maybe getting that appropriate field is the answer for me. If I could use the built-in dBase driver, it would save me a lot of heartache. Is there any way I can know what type of field needs to be in the table for me to link to it that way?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top