G
Guest
I am working on a VB.NET WINFORM project with MS Access as database. The
database has 2 tables:
1) PROJID: has the following fields: projid & projnm, projid is the primary
key
2) PROJCOST: has the following fields: projid, currtyp, costtyp, yr, annamt.
Primary keys are: projid, currtyp, costtyp, yr.
In the MS Access Relationships design for this database, I setup a
relationship between PROJID & PROJCOST tables related by 'projid' field and
the 'Enforce Referential Integrity' box is checked.
On one window form, I created a dataview populated with data from table
PROJID. Several text box fields on this form are binded to this dataview,
user can change data in table PROJID from these text fields.
To save data to table, I use DataAdapter.Update command. This is where I
keep getting an error saying:
"Error: Microsoft JET Database Engine: The record cannot be deleted or
changed because table 'projcost' includes related records"
This happen even when the primary key field in PROJID is not changed. Please
let me know if you have way to solve this problem
Thanks
database has 2 tables:
1) PROJID: has the following fields: projid & projnm, projid is the primary
key
2) PROJCOST: has the following fields: projid, currtyp, costtyp, yr, annamt.
Primary keys are: projid, currtyp, costtyp, yr.
In the MS Access Relationships design for this database, I setup a
relationship between PROJID & PROJCOST tables related by 'projid' field and
the 'Enforce Referential Integrity' box is checked.
On one window form, I created a dataview populated with data from table
PROJID. Several text box fields on this form are binded to this dataview,
user can change data in table PROJID from these text fields.
To save data to table, I use DataAdapter.Update command. This is where I
keep getting an error saying:
"Error: Microsoft JET Database Engine: The record cannot be deleted or
changed because table 'projcost' includes related records"
This happen even when the primary key field in PROJID is not changed. Please
let me know if you have way to solve this problem
Thanks