473,385 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Key Violations

10
i am creating a database for organising training courses and logging staff attendance.

Tables:
1. TrainingSessions(primary keys: POPCode, ModuleCode, Section, SessionCode)
2. TrainingSessionAttendance(primary code: SessionCode, Team, StaffCode)
3. StaffList table (primary keys: StaffCode & Team).

The relationships are:

many to one form 1 to 2 across the SessionCode field.
many to one from 3 to 2 across both StaffCode & Team

I created an append query to enter records for all staff members on a particular team to the attendance table (each course is run per a team). This is taking SessionCode from TrainingSessions and StaffCode and Team from the StaffList table.
In dataview the query is selecting the records i need but access gives me a key violation error which i dont understand..

Any help is appreciated!
Oct 5 '06 #1
2 3844
PEB
1,418 Expert 1GB
Hi,

In fact what is the primary key for the table
2. TrainingSessionAttendance(primary code: SessionCode, Team, StaffCode)

Only SessionCode?

In the indexed property what is indicated for the field SessionCode?

It should be Yes dublicates!

:)

i am creating a database for organising training courses and logging staff attendance.

Tables:
1. TrainingSessions(primary keys: POPCode, ModuleCode, Section, SessionCode)
2. TrainingSessionAttendance(primary code: SessionCode, Team, StaffCode)
3. StaffList table (primary keys: StaffCode & Team).

The relationships are:

many to one form 1 to 2 across the SessionCode field.
many to one from 3 to 2 across both StaffCode & Team

I created an append query to enter records for all staff members on a particular team to the attendance table (each course is run per a team). This is taking SessionCode from TrainingSessions and StaffCode and Team from the StaffList table.
In dataview the query is selecting the records i need but access gives me a key violation error which i dont understand..

Any help is appreciated!
Oct 8 '06 #2
Aidan
10
I have set all 3 listed fields in tblTrainingSessionAttendance as the Primary Key and the index on all of them is, as you say, set to duplicates ok. The 3 fields combined will create a unique key for each staff member attending a particular course. I dont understand where the conflict is arising from.
Thanks,
Aidan
Oct 9 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought...
13
by: mfreeman | last post by:
The minimal code (VB.NET 2003) needed to show this problem is shown below. All I do is loop through the records in the table and update them without making any changes. Out of 600 records, about...
2
by: Willem Voncken | last post by:
Hi guys, might be a silly question, but i'm wondering whether it is even possible to generate access violations when using C#? I'm new at c# programming, but i have some experience with c++....
1
by: jasonlakewhitney | last post by:
I have an MDB on my PC with 3 linked tables to a SQL database. I only have permissions on the SQL db to insert and delete records. The linked tables are LnktblA, LnktblB, LnktblC and the main MDB...
11
by: gnortenjones | last post by:
I have a linked table (to an oracle db), and I am trying to run a simple update query against it to change some data, but I am getting the following error: "...didn't update 0 fields due to a type...
3
by: Richard Weeks | last post by:
My question, stated as simply as possible, is: must a constraint violation, as defined by the standard, cause compilation to halt? I believe that in the presence of a constraint violation, at...
5
by: John | last post by:
Hi I have developed the following logic to handle db concurrency violations. I just wonder if someone can tell me if it is correct or if I need a different approach.Would love to know how pros...
15
by: Frank Swarbrick | last post by:
I have the following three tables DROP TABLE CALLTRAK.SERVICE_CODES @ CREATE TABLE CALLTRAK.SERVICE_CODES ( CODE CHAR(1) NOT NULL , CONSTRAINT SERVICE_CODES_PK PRIMARY KEY (CODE) ,...
3
by: Gerhard | last post by:
Hi I have a combobox on a form which gets it's Row Source from a table. I then use an Append Query to save the selected data in the combobox to a file. Everything works fine. The Combobox's...
10
by: MeeMee | last post by:
Hi I have a problem appending data into an oracle table from access. I imported the new data from an excel sheet into a table in access and useed an append query to add the data into a linked...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.