Data Shaping & sending email

Results 1 to 6 of 6

Thread: Data Shaping & sending email

  1. #1
    Jermaine Jones Guest

    Default Data Shaping & sending email

    1)How do I access a field in a different recordset? For example I have a itemsOrdered table that consist of 3 fields (ProductID, quantity, orderID). I want to get the product name from the Products table based on the product ID. Sesions are involved also. How do I access the data?<BR><BR>2) I want to send the the 3 fields and the product name in an email using CDONTS, I only having it working if I only buy 1 product. How do I get all the info based on session, productID, ect.?

  2. #2
    David Tremayne Guest

    Default RE: Data Shaping & sending email

    What you want is to cross reference the two tables. This is what I believe you should do, the two tables should have some number in common.<BR>ItemsOrdered<BR> -OrderID (AutoNumber)<BR> -ProductID (Numberic)<BR> -Quantity (Numberic)<BR>Products<BR> -PID (AutoNumber)<BR> -Product_Name (Text)<BR><BR>And It would be<BR>ObjRS.Open "Select P.Product_Name, P.PID, I.OrderID, I.ProductID, I.Quantity From Products P, ItemsOrdered Where I.ProductID = P.PID And P.PID = " & Session("ProductID")<BR><BR><BR>I Think thats what you want :p<BR>I tried :P<BR>

  3. #3
    David Tremayne Guest

    Default RE: Data Shaping & sending email

    Oops ItemsOrdered I

  4. #4
    Jermaine Jones Guest

    Default RE: Data Shaping & sending email

    I have that, and it works! My main concern is the email. I want to send email through CDONTS, listing the product name, quantity, ect. It only displays one product name in the email, no matter how many products you selected (strProdName. Should I introduce an aray?<BR><BR>Dim objCDO<BR>Set objCDO = Server.CreateObject("CDONTS.NewMail")<BR>objCDO.To = ""<BR>objCDO.From = Request.form("strEmail")<BR>objCDO.Subject = "Catering Order Form " <BR>objCDO.Body = Request.form("strFirst") & Request.form("strLast") & VbCrLf & Request.form("strPhone") & VbCrLf & Request.form("strEmail") & VbCrLf & Request.form("strShipAddress") & VbCrLf & Request.form("strShipCity") & VbCrLf & Request.form("strShipState") & VbCrLf & Request.form("strShipCountry") & VbCrLf & Request.form ("intOrderID") & VbCrLf & (strProdName) & VbCrLf & (intProdPrice) & VbCrLf & (intQuant) & VbCrLf & Request.form("strOrderItem") & VbCrLf & Request.form("intTotal")<BR><BR>objCDO.MailFormat = 0<BR>objCDO.Send

  5. #5
    Join Date
    Dec 1969

    Default RE: Data Shaping & sending email

    in the body movenext through the recordset and display each product name. if you are asking how to show all the selected prod names either save them to a DB or to an array and step through them.<BR><BR>Hope that makes it clear as mud :)

  6. #6
    David Tremane Guest

    Default RE: Data Shaping & sending email

    No clue, I&#039;ve never done email in asp

Posting Permissions

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