Marking products

Results 1 to 2 of 2

Thread: Marking products

  1. #1
    Linda Jones Guest

    Default Marking products

    I am building an e-commerce site. I can do everything just about. My problem is I want each product to be removed from database when it has been bought. Each product is unique and cannot be bought again. I am using access and vbscript...<BR>Thnk You<BR>Linda

  2. #2
    Join Date
    Dec 1969

    Default RE: Marking products

    A suggestion:<BR><BR>I don&#039t think you *REALLY* want to remove the product when it is first sold. Consider: The sale might be cancelled (bad credit card?) or the merchandise returned as unsuitable, etc., etc.<BR><BR>Better, I think, to simply add a field to the record that says "SOLD" and then give it a "false" value by default. When the item is sold, change the value to "true". Then, when you select items for viewing, add the qualification "...WHERE SOLD=false..." to your SELECT query. <BR><BR>Finally, once a week or once a month or whatever, you run a batch operation where you really do remove all the sold items.<BR><BR>(Actually, what you probably want to do is first "log" them as having been removed on such-and-such a date. The first time you are audited--by the IRS or your state tax agency or even because you want to borrow money from the bank--you will *definitely* appreciate the value of such a log.)<BR><BR>Anyway, when ready to finally "clean up" the DB, you can then simply execute the SQL statement:<BR><BR>DELETE FROM whateverTable WHERE SOLD=true AND DateSold &#060; #somedate#<BR><BR>Hmmm....and I just realized then you don&#039t really need the separate SOLD could just treat a blank value in the DateSold field as being the same thing as SOLD=true. Well, your choice. The extra flag isn&#039t costly and might be nice to have as insurance.<BR><BR>

Posting Permissions

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