Pontificateur said:
When I connect to the FoxPro database, I select [Link to tables], then in
the resulting dialog box I choose files of type ODBC. This brings up the
ODBC drivers, from which I select Machine Sources and the FoxPro Tables
driver. .....
Good so far, but I'd also try using Administrative Tools to create an ODBC
data source that points specifically to the directory where your tables are,
and I'd try both User and System DSNs.
At that point, if I -cancel- the selection process, I still get the table
link in Access but can only read the records, not write to them.
That would be because ODBC might not have a good way to know which row to
update. However, in my experience with ODBC data sources that point directly
to the table directory and are saved as User or System data sources the
tables open just as if they were Access tables and you can change anything
you want by editing the cells. Access/ODBC must have some sort of PK system
underneath to know which row you're working with.
However, if
I go ahead and select all fields which make up the original FoxPro key for
that table, I can both read and write and the records present themselves
as
expected.
Makes sense.
If I do not specify the key fields, the whole key fields, and nothing but
the key fields in the "unique" dialog box,
Um, why would you want to specify it any other way?
Visual FoxPro tables have indexes that can be specified as unique and that
enforce non-duplication of keys. Such an index can be for a single field
only (InvoiceDetailID) or a combination of fields such as Str(InvoiceNumber)
+ Str(LineItemNumber) for an invoice details table.
the records are read/write, but
can present multiples or none (for some keys) when viewed through the
link.
I'm not surprised at your unpredictable results. When a Fox index is
specified as Primary or Candidate then the Fox data engine would expect to
use these indexes when identifying the row you're on via ODBC.
Is there a problem with specifying the unique fields? Do you know what the
Fox index expressions are, or are you having trouble guessing them? If you
really don't know what they are and the tables aren't big or confidential
you could zip them up and send them to me and I'll take a look.