Hi, I am creating a Web site using ASP and am trying to display the menu items from an Access database. I am confused how to set up the tables in Access and how to set up the relationships...
Just to clarify, I have a main menu and a sub-menu, and have 2 tables in my Access database called tblMainMenu and tblSubMenu.
The Web site will be simple. When a link is clicked on the Main menu then the sub-menu will change and an article will be displayed in the centre of the page.
I have stored the articles in a 3rd table called tblArticles.
I thought the best way to do this is for each link in the Main menu and the Sub-menu to have their own unique Link ID number. This way, I can submit the page to itself and check the QueryString for a LinkID, and depending on what the LinkID value is it will query the Access database and retrieve the relevant values for the sub-menu, as well as retrieve the relevant article.
Is this a good way to do this?
I have created a 4th table called tblLinkId to store the unique Link ID values for the links in the Main menu table and the sub-menu table. But how can I get Access to automatically allocate a unique Link ID value for each menu item? I created a foreign key field in both tblMainMenu and tblSubMenu and created a link between these foreign key fields and the primary key of tblLinkId, but this doesn't work. Access creates a 1-to-many relationship, which isn't what I want. One unique Link ID should be related to one unique menu item.
How can this be done?
Thanks for your help,
May
Just to clarify, I have a main menu and a sub-menu, and have 2 tables in my Access database called tblMainMenu and tblSubMenu.
The Web site will be simple. When a link is clicked on the Main menu then the sub-menu will change and an article will be displayed in the centre of the page.
I have stored the articles in a 3rd table called tblArticles.
I thought the best way to do this is for each link in the Main menu and the Sub-menu to have their own unique Link ID number. This way, I can submit the page to itself and check the QueryString for a LinkID, and depending on what the LinkID value is it will query the Access database and retrieve the relevant values for the sub-menu, as well as retrieve the relevant article.
Is this a good way to do this?
I have created a 4th table called tblLinkId to store the unique Link ID values for the links in the Main menu table and the sub-menu table. But how can I get Access to automatically allocate a unique Link ID value for each menu item? I created a foreign key field in both tblMainMenu and tblSubMenu and created a link between these foreign key fields and the primary key of tblLinkId, but this doesn't work. Access creates a 1-to-many relationship, which isn't what I want. One unique Link ID should be related to one unique menu item.
How can this be done?
Thanks for your help,
May