|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, this problem is slowly sending me mad, can anyone help... please!
I have a table in my database called "Function List" with a primary key "ID". It has a number of fields, one of which is foreign key "Template ID". I have another table called "Interfaces" which has Two fields that make up the primary key, "ID" (Foreign key from "Function List") and "Label", this table also has a field "Template ID". This field is unecessary (it can be worked out by combining this table with "Function List") and can also cause inconsistancies in the data if it is changed without updating the field in "Function List". And finally I have a table "Template Interfaces" which has two fields that make up its primary key "Label" and "Template ID" I want to remove the field "Template ID" from the table "Interfaces" but I have the following problem: At the moment when I join "Interfaces" with another table called "Template Interfaces" on the "Label" field and "Template ID" field, the resulting recordset can be updated (which is what I want). If I delete the "Template ID" field from "Interfaces" and then join "Function List" with "Interfaces" creating a recordset with all the fields from "Interfaces" and the "Template ID" field from "Function List" and then join this with "Template Interfaces" in the same way as before, the recordset becomes non-updateable! Does anyone know why? Thank you in advance Sandra x |
|
#2
|
|||
|
|||
|
Update: To Clarify my problem
These three tables are part of a much larger database (hence the use of primary keys with >1 fields), I have re-expressed the problem using a real-life example to try and show the physical (and implied) relationships between the tables. Employee: Name -> Key (eg Fred) Job (eg Engineer) EmployeeTasks: Name -> Key (eg Fred) Task -> Key (eg Make Coffee) Job (eg Engineer) TaskSpec Task -> Key (eg Make Coffee) Job -> Key (eg Engineer) Description (eg Make coffee for eng director) Relationships: Employee.Name -> EmployeeTasks.Name Wordy Relationships 1) An employee has a job 2) Each job has a number of tasks (1 to Many between Employee and EmployeeTasks) 3) Each task has a job dependant description 4) Many employees can have the same job and tasks (Many to 1 between EmployeeTasks and TaskSpec) The Job Field in EmployeeTasks should be removed as the information can be derived from the employee table (standard normalisation) but... If I create these tables and make a query with the following joins then the recordset is non updateable Joins: Employee.Name -> EmployeeTasks.Name Employee.Job -> TaskSpec.Job EmployeeTasks.Task -> TaskSpec.Task But If I just use the EmployeeTasks and TaskSpec Table and do the following joins then it is updateable Joins: EmployeeTasks.Job -> TaskSpec.Job EmployeeTasks.Task -> TaskSpec.Task Hope someone can help Thanks again Sandra |
|
#3
|
|||
|
|||
|
What I really need to know is: are the data types and field size of the primary key and the foreign key the same. also if the primary key is a autonumber format, the foreign key also needs to be "number" for data type and "Long Integer" for the field size. failing this, check your data that you have for the primary key fields, there may be two entries that is the same.
|
|
#4
|
|||
|
|||
|
Thankyou for taking time to look at my problem
I found out that the problem was with me trying to do a 1-to-many-to-1 join in the query. Although this produces unique records, access seems to dislike this approach and makes the recordset non updateable. To solve this problem I used a subquery instead. Sandra Last edited by SandraJemm : July 8th, 2004 at 08:33 AM. Reason: Type |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Joins giving Non Updateable Recordset |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|