I have two tables that have one to many relationships (say TableA - 1 and TableB - many). Then I run a join query to view the data(recordset - rst) . When I try to delete a record from this query using rst.Delete statement it gives me the following error,
-2147900, [Microsoft][ODBC SQL Server Driver][SQL Server]DELETE statement conflicted with COLUMN REFERENCE constraint ‘FK_TableB_TableA’. The conflict occurred in database ‘dbBooks’, table ‘TableB’, column ‘UserID’.
Does anybody know how to fix this problem? I tried refresh and requery after the delete statement but didn’t work. But it deletes the data from TableB.
-2147900, [Microsoft][ODBC SQL Server Driver][SQL Server]DELETE statement conflicted with COLUMN REFERENCE constraint ‘FK_TableB_TableA’. The conflict occurred in database ‘dbBooks’, table ‘TableB’, column ‘UserID’.
Does anybody know how to fix this problem? I tried refresh and requery after the delete statement but didn’t work. But it deletes the data from TableB.