Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7779497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:39:13+00:00 2026-06-01T18:39:13+00:00

EDIT: was a design issue my revised final ERD https://i.stack.imgur.com/xDj6i.png I am undergoing a

  • 0

EDIT: was a design issue

my revised final ERD
https://i.stack.imgur.com/xDj6i.png

I am undergoing a computing project for Alevel computing.
The project consists of a 6 tabled Microsoft access database. I am using vb.net to code the application for a student tracking system.

My ERD is below:
http://i.imgur.com/Xl0gS.png

My problem: How to insert a new compound Primary key into a existing table?
If I increment StudID and CourseID in tblContact then I need to increment them in tblStudentCourse which leads to records not pointing to the right directions..

For enforcing the relationships I am using the .relations with the dataset.

'Student - StudentCourse
    DS.Relations.Add(New DataRelation("StudStudCorRelation", DTStudents.Columns("StudID"), DTStudentCourses.Columns("StudID"), True))
    'Course - StudentCourse
    DS.Relations.Add(New DataRelation("CourStudCorRelation", DTCourses.Columns("CourseID"), DTStudentCourses.Columns("CourseID"), True))

    StudCourseCompPK(0) = DTStudentCourses.Columns("StudID")
    StudCourseCompPK(1) = DTStudentCourses.Columns("CourseID")
    StudCourseContactCompPK(0) = DTContacts.Columns("StudID")
    StudCourseContactCompPK(1) = DTContacts.Columns("CourseID")
    StudCourseStudTMACompPK(0) = DTStudentTMAS.Columns("StudID")
    StudCourseStudTMACompPK(1) = DTStudentTMAS.Columns("CourseID")
    'Enforces the relations between these 2 keys
    DS.Relations.Add(New DataRelation("CPKContact", StudCourseCompPK, StudCourseContactCompPK, True))
    DS.Relations.Add(New DataRelation("CPKStudentTMA", StudCourseCompPK, StudCourseStudTMACompPK, True))
    DS.EnforceConstraints = True

    DTStudentCourses.PrimaryKey = New DataColumn() {DTStudentCourses.Columns("StudID"), DTStudentCourses.Columns("CourseID")}

But the last line here:

    DTStudentCourses.PrimaryKey = New DataColumn() {DTStudentCourses.Columns("StudID"), DTStudentCourses.Columns("CourseID")}

Needs to be used to retrieve the keys from tblStudentCourse which I am unsure about what todo

If anybody could take a look at this problem I would be very grateful.

Harry

Revised ERD

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T18:39:14+00:00Added an answer on June 1, 2026 at 6:39 pm

    If I increment StudID and CourseID in tblContact then I need to
    increment them in tblStudentCourse which leads to records not pointing
    to the right directions.

    No, values increment in only one table. Anywhere else you use those incremented values, you essentially copy them.

    So tblStudent.StudID might be an integer that gets incremented by one for each new student. tblCourse.CourseID might be an integer that gets incremented by one for each course. To store data in tblStudentCourse, you copy one appropriate, existing integer from tblStudent.StudID and another appropriate, existing integer from tblCourse.CourseID.

    StudID is incremented in only one place–tblStudent. CourseID is incremented in only one place–tblCourse.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've ran into a design issue; in a project, i have three tables: League,
EDIT: I know it is a little strange design, and so it is difficult
When you edit a simple page in the design view, you can add an
I'm trying to design a layout to hold a textview an edit text and
EDIT: Now a Major Motion Blog Post at http://messymatters.com/sealedbids The idea of rot13 is
With several forms of mine, I occasionally run into the following issue: I edit
[EDIT: further digging revealed a different root issue. I'm rephrasing the question, but leaving
This is issue about LANGUAGE DESIGN. Please do not answer to the question until
I've got a bit of a design issue here. I've got a view: <ItemsControl
I'm having an odd issue with whitespace in a design I'm building. I created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.