Unanswered: Inserting foreign keys through form of the website
I have a little problem, I ‘ve done two tables in a SQL Server Database that contains the main information about offers of cars for a website. The tables are those:
Offer_num (Key Field) (Identity)
Car_num (Foreign Key)
Car_num (Key Field) (Identity)
Type_of_car_num (for example 2-Van, 3-Truck,..)
Trade_Name_num (for example 5-Audi, 6-Hunday, 7-Ford,..)
Model_Num (for example 3-Golf TDI, 4-A3,..)
The problem begins when I want introduce the data through of a form in the website. I introduce “Date, Title, Description” of “Offer_Table” without problem, but I don’t know how to insert the “Car_num” (Foreign Key), this field must be having equal to the “Car_num” (Key Field) (Identity) of “Cars_Table” generated in the same insert through of form. I use Dreamweaver MX with ASP VBScript to design the dynamic page.
Another question is: Its possible inserts two “Car_num” (Foreign Key) in the “Offer Table”?. How can I do it?. Because in one offer can be have one or more cars, therefore I need two or more columns in the “Offer_Table” that contains the “Car_num” (Foreign Key) for each kind of car introduced in several times in the “Cars_Table”. For example, I would need for the “Offer_num” 1, the “Car_num” 1,2 and 3.
How can I introduce by the form this three columns of “Car_num” when I fill an offer?. And therefore at the same time I introduce this three “Car_num” in the “Cars_Table”?