E-Commerce Receipt from Multiple Tables

Results 1 to 4 of 4

Thread: E-Commerce Receipt from Multiple Tables

  1. #1
    Join Date
    Dec 1969

    Default E-Commerce Receipt from Multiple Tables

    I&#039m trying to make an online receipt that pulls data from multiple tables in an Access 2000 database and if they purchased multiple items, loop them to provide something that looks similiar to a credit card statement. I&#039m having trouble setting the multiple tables and pulling in the data. Does anyone know where I can find some sample code for this type of application? Thanks for any responses.

  2. #2
    Duc Guest

    Default RE: E-Commerce Receipt from Multiple Tables

    It&#039s sound to me that what you really need is how to write SQL Statement. My suggestion is to buy an SQL References book.<BR>Duc

  3. #3
    Susanne Guest

    Default RE: E-Commerce Receipt from Multiple Tables

    The sql can be very simple but the real challenge for me was getting the scripting to loop through the record set correctly.<BR><BR>You can do this by creating a recordset for each table. I have done it with 2 tables, Customer (rsOrder) and OrderItems (rsItems). <BR><BR>It might also work with an inner join, but I think the loop is simplier if you are only looping through the recordset with the order items.<BR><BR>(You can test your loop by substituting a Response.write) This can be done offline.<BR><BR>I have a solution that is working with VBscript and JMail.<BR><BR>It has a little problem in that it gives the it does not colate the results.<BR><BR>It gives all the items, then all catalog numbers, then all quanity, then all prices (of course I don&#039t need the price and both the catalog number and item, but this keeps the store owner on top of updating the info in the database)<BR><BR>the loop is:<BR><BR>Items =""<BR>Do Until rsItems.EOF<BR>Item = Item & rsItems.Fields.Item("oiItem").Value & vbCrLf<BR>CatalogID = CatalogID & rsItems.Fields.Item("oiCatalogID").Value & vbCrLf<BR>Quanity = Quanity & rsItems.Fields.Item("Quanity").Value & vbCrLf<BR>Price = Price & rsItems.Fields.Item("oiPrice").Value & vbCrLf<BR>Items = Item & CatalogID & Quanity & Price<BR>rsItems.MoveNext<BR>Loop<BR><BR>Then in the JMail part <BR><BR>JMail.AppendText "Items Ordered for order " & OrderID<BR><BR>JMail.AppendText Items & vbCrLf<BR><BR>If you need more email me<BR><BR>Susanne<BR>spb@mwrn.com<BR><BR><BR><BR>

  4. #4
    Join Date
    Dec 1969

    Default RE: E-Commerce Receipt from Multiple Tables

    there is a great tutorial in the asp articles on this site for "data shaping"...with this method you will be able to include as many tables and relationships as you would like...also, all the code is there for you to use. I don&#039t remember the name of the article, so you will have to search for it. Strongly recommend looking at it, it&#039s great!

Posting Permissions

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