This topic is locked

3 Component Key

9/3/2005 3:52:51 PM
ASPRunnerPro General questions
W
wlhoward author

Hello,
I'm having a problem with a file relationship setup and hope someone can help.
I have three linked Access tables using the following key formats:
Product Table Key

============

Product_ID
Product_Size Key

===========

Product_ID

Product_Size
Product_Color Key

=============

Product_ID

Product_Size

Product_Color
I have the link between the product and product_size table working properly.
I can not get the link between the product_size and Product_colors to work properly.
I'm leaving Add Page unchecked for both the Product_ID and Product_Size fields on the formatting screen of the Product_Colors table and would expect the code to pass both variables from the Product_Size master record.
It only passes the Product_Size field and the Product_ID field is not primed. The GetRequestForm("masterkey") variable is set as the default for both fields.
What is the proper way to handle this?
I've throughly searched the forum and cannot locate the resolution there.
Thanks,

W
wlhoward author 9/3/2005

Also...
I've tried using the Addwhere() function to have the code limit the records selected by the SQL query to the specific product ID.
It displays the correct records in the body of the List Screen but the master record (product_price) that shows at the top of the screen always shows the first master record instead of the selected product_price record.
Thanks,

Sergey Kornilov admin 9/5/2005

Hi,
ASPRunner doesn't support composite foreign keys now.

The only supported master-detail relationship is one-to-many. So only one master row can be displayed on in the top the list page with the current version of ASPRunnerPro.
However you may pass Product_ID value to Product_Color edit page via session variables. To do that please enter Session("Product_ID") as a default value for Product_Color.Product_ID field. Then build your pages and add the following line to ..._list.asp file for Product_Size table:

if GetRequestForm("masterkey")<>"" then Session("Product_ID")=GetRequestForm("masterkey")


Also you can modify DisplayMasterTableInfo function in ..._list.asp file to display all the matching rows.
You don't need to set the default value for fields. You may just remove them from Add page on Formatting tab in ASPRunnerPro and they would be filled automatically.