Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 27th, 2004, 06:02 AM
SandraJemm SandraJemm is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 3 SandraJemm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Joins giving Non Updateable Recordset

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

Reply With Quote
  #2  
Old May 27th, 2004, 09:28 AM
SandraJemm SandraJemm is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 3 SandraJemm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #3  
Old June 13th, 2004, 02:50 AM
smercer smercer is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 11 smercer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old July 8th, 2004, 08:32 AM
SandraJemm SandraJemm is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 3 SandraJemm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wink

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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Joins giving Non Updateable Recordset


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT