Steve Rowson

Results 1 to 3 of 3

Thread: Steve Rowson

  1. #1
    Steve Rowson Guest

    Default Steve Rowson

    I am asking users to enter product numbers they wish to order. So they go to page1 and enter a product number. I send it to page2 and validate it. If it is valid I want to save the ProductID and Quantity required(which will be &#060;%=RS("ProductID") and the Quantity in an array to use later. I then want to send them back to page1 to enter another product etc. I might end up with 1 part - or it could be 10 depending on how many they want to order. Having got these for example 5 values of ProductID into an array, I then need to call them and insert them into a table called WarrantyTable along with another session variable called WarrantyID.<BR>This will look something like:<BR>Insert into WarrantyTable values session("warrantyID") and ProductID (the first value from the array)<BR>Insert into WarrantyTable values session("warrantyID") and ProductID (the second value from the array)<BR>etc.<BR>My questions are:<BR>1) On the page which validates the part, how do I put the ProductID into an array?<BR>2) When the user has finished adding products, how do I call the values from the array so that, if the array contains 5 ProductIDs, 5 records are added to the WarrantyTable along with the WarrantyID (which is a session variable)<BR>Thanks for any help.<BR>

  2. #2
    Jason S. Harmon Guest

    Default RE: Steve Rowson

    Here&#039s the wierd thing about arrays in Session variables...you can&#039t. But you can assign the array to a variant, and then store it, and vice-versa. <BR>Storage Example:(pretty straight forward)<BR><BR>Dim aryParts(1,2)<BR> aryParts(0,0) = Request("PartID")<BR> aryParts(0,1) = Request("Quantity")<BR>Session("Parts") = aryParts()<BR><BR>Extraction:<BR>Dim aryParts()<BR>aryParts() = Session("Parts")<BR>strSql1 = "Insert into WarrantyTable values (" & _<BR> Session("WarrantyID") & ") and ProductID = " & aryParts(0,0)<BR>strSql2 = "Insert into WarrantyTable values (" & _<BR> Session("WarrantyID") & ") and ProductID = " & aryParts(0,1)<BR><BR>Don&#039t quote me on any of this, it&#039s off the top of my head. But that&#039s basically what you have to do to pass arrays around in Session collections. Good luck!

  3. #3
    Steve Rowson Guest

    Default RE: Steve Rowson

    Thanks Jason - sounds good, trying it now, watch this space.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •