JavaDude32
Programmer
Okay, I have a Access database that has 3 main index fields (course_Id, module_Id, question_Id). This is for storing student exams and I came up with a few solutions although currently it is just stored as 1 flat table.
Data Format is as follows:
Question AnsA ... Lesson_Reference course_Id module_Id question_Id.
Questions are looked up using a counter for question_Id with a static value for course_Id and module_Id. Questions are editted, created and deleted through online html forms and sql query objects (Students & Exam Writters never use the Access database program directly). My question is can I design the question_Id field or something to where question_Id acts an AutoNumber but a little differently? Basically the behavior I want is this:
Add a question
Questions 1, 2 & 3 already exist for module 1 course 1.
So new question has question_Id 4
Delete question #2
Make question #3 question #2 now and question #4 question #3
I want to avoid running multiple update queries to set all the higher question_Ids down on a deletion, instead, I'd like to issue 1 INSERT query or DELETE query and have the Access database handle re-numbering. I noticed AutoNumber doesn't reset all values down on a deletion. Queries are issued using OBDC with the Access Database as a data source with a DSN. Can anyone help me figure this out please?
Data Format is as follows:
Question AnsA ... Lesson_Reference course_Id module_Id question_Id.
Questions are looked up using a counter for question_Id with a static value for course_Id and module_Id. Questions are editted, created and deleted through online html forms and sql query objects (Students & Exam Writters never use the Access database program directly). My question is can I design the question_Id field or something to where question_Id acts an AutoNumber but a little differently? Basically the behavior I want is this:
Add a question
Questions 1, 2 & 3 already exist for module 1 course 1.
So new question has question_Id 4
Delete question #2
Make question #3 question #2 now and question #4 question #3
I want to avoid running multiple update queries to set all the higher question_Ids down on a deletion, instead, I'd like to issue 1 INSERT query or DELETE query and have the Access database handle re-numbering. I noticed AutoNumber doesn't reset all values down on a deletion. Queries are issued using OBDC with the Access Database as a data source with a DSN. Can anyone help me figure this out please?