J
JeffM
I am programming in C++. Moving data from a large number of text files into
an Access database with several tables. While adding a record to one of the
tables I get an Exception with the message
"The changes you requested to the table were not successful because they
would create duplicate values in the index, primary key, or relationship"
When I am adding the records rather than using an autonumber for the primary
key I am using a number and scrolling through the current records from first
to last using the code
MoveFirst();
while (!IsEOF())
MoveNext();
I then get the ID of the last record and increment it by 1 to make my next
Primary Key ID. I have stepped through the code and found that at some
undetermined point in the import the MoveNext() stops returning the last
record, so the next ID I try to add is already in the database. Hense the
above error.
If I go into the database in Access it appears fine and all the records upto
the exception are there including the one that MoveNext will not go to.
I am begining to think it must be an ODBC driver issue but I am running XP
and Access 2000 (I am unsure which service packs).
Has anyone got any ideas?
an Access database with several tables. While adding a record to one of the
tables I get an Exception with the message
"The changes you requested to the table were not successful because they
would create duplicate values in the index, primary key, or relationship"
When I am adding the records rather than using an autonumber for the primary
key I am using a number and scrolling through the current records from first
to last using the code
MoveFirst();
while (!IsEOF())
MoveNext();
I then get the ID of the last record and increment it by 1 to make my next
Primary Key ID. I have stepped through the code and found that at some
undetermined point in the import the MoveNext() stops returning the last
record, so the next ID I try to add is already in the database. Hense the
above error.
If I go into the database in Access it appears fine and all the records upto
the exception are there including the one that MoveNext will not go to.
I am begining to think it must be an ODBC driver issue but I am running XP
and Access 2000 (I am unsure which service packs).
Has anyone got any ideas?