[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

04/04/2007 at 09:55AM PDT, ID: 22492326
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.2

Insert Multiple Records into One Table

Asked by cuconsortium in Macromedia UltraDev, Adobe Dreamweaver

Tags: insert, multiple, records, table, one

Dear Experts,

  I have 4 ASP pages.  I’m using Dreamweaver MX 2004 and SQL Server 2000.   The process needs to locate the Customer in the database first, then proceeds with creating order and order details.

1. locate.asp:  to search for Customer in the database
   Contains a text box to enter Customer ID and a Submit Button

2. Result.asp:
   Displays the customer record based on the Customer ID entered
   Provides a link to Order.asp page, this link passes the CustomerID to the Order.asp
   page

3. Order.asp
    Contains a text box for Order Date, a Multiline text field for Order Remarks, a hidden
    text box for CustomerID, and a Submit button.
    When the Submit button is clicked, it creates a new Order record in the Order table.
     Then, after clicking Submit button it takes you to the next page, OrderDetail.asp

4. OrderDetail.asp
    This page supposed to capture the OrderID that was created from the last page,
    Order.asp.
    Contains 11 check boxes labeled with different product names for each check box and
    a Submit button.
     The value of each check box would be the Product ID for each product.
    When the Submit button is clicked, the Order ID and the check box values needs to be inserted into OrderDetails table side by side as multiple records.

The Database structure is as followed:

Customer Table
----------------
CustomerID
LastName
FirstName

Order Table
------------------
OrderID
OrderDate
OrderRemarks
CustomerID

OrderDetails Table
-------------------
OrderDetailsID (auto increment number)
OrderID
ProductID

Product Table
----------------
ProductID
ProductName


Example:

Customer Table

CustomerID  LastName  FirstName
----------------------------------------
1                    John           Smith
2                    May            Lee
3.                   Peter          Williams

Order Table

OrderID   OrderDate   OrderRemarks           CustomerID
-----------------------------------------------------------
1               4-1-2007    Important Customer      2
2               4-2-2007    None                              1
3               4-3-2007    Urgent! Bluh..                2

OrderDetails  Table

 OrderDetailsID       OrderID         ProductID
----------------------------------------------------
1                               2                    3
2                               2                    5
3                               1                    4
4                               1                    2
5                               1                    3


Product Table

ProductID          ProductName
----------------------------------------
1                         Pen
2                         Box
3                         Shirt
4                         CD
5                         Paper
6                         board
 

My Question is:

On OrderDetail.asp page, How do I capture the OrderID that was created on Order.asp page?

On Order Detail.asp page, How do I insert the OrderID and ProductID into the OrderDetails Table side by side as Multiple records with one submit.

Any suggestion on change in design is welcome.  The only thing fixed is The user needs to first find the Customer with CustomerID, then proceeds with making orders.

Would a drop down list box be easier to work with than several check boxes?


Thank you!
[+][-]04/04/07 10:10 AM, ID: 18852061

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Macromedia UltraDev, Adobe Dreamweaver
Tags: insert, multiple, records, table, one
Sign Up Now!
Solution Provided By: DanielWilson
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04/04/07 10:16 AM, ID: 18852106

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/04/07 10:43 AM, ID: 18852289

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/25/07 12:02 PM, ID: 19159236

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05/25/07 12:51 PM, ID: 19159567

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/15/07 03:45 PM, ID: 19296048

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]06/20/07 06:35 PM, ID: 19329860

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91