ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 24th, 2003, 03:06 AM
suzy suzy is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Malaysia
Posts: 4 suzy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Single Transaction

Hi all

I am trying to make a sales form using ASP and MSAccess.

The problem is, how do I update the sales table with many items from the inventory(stuff that are bought in a single sales transaction, like one teddy bear and two snicker bars) and give them the same SaleID? The SaleID is generated automatically in Access.

Right now, each item that is entered to the sales table gets a new SaleID. Each item is entered one at a time. I want a way which would show (even if it is by adding an additional field to the table and not using the SaleID) that they are from the same transaction.

So how do I do this? Or is it possible at all?

Thanks in advance.

Last edited by suzy : January 24th, 2003 at 03:22 AM.

Reply With Quote
  #2  
Old January 24th, 2003, 11:19 AM
numbernine numbernine is offline
Up To His Eyes In Ads
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Chicago
Posts: 160 numbernine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 25 sec
Reputation Power: 7
Hi Suzy,
You'd need a third table joining inventory and sales with a concatenated key of the primary key from the other two tables.

So you'd have (the * means key):

Inventory
* ItemID (autonumber)
ItemDetail

Sales
* SalesID (autonumber)
CustomerID

Sales_Items
* SalesID
* ItemID

Reply With Quote
  #3  
Old January 25th, 2003, 02:15 AM
suzy suzy is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Malaysia
Posts: 4 suzy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks numbernine.

But each item's sale is recorded on at a time to the sale table. Which means that each time a new SaleID is generated. If two items are sold in a single sale each item will be given a new SaleID, but I want a way which would show that they were bought in a single transaction. If I add a table, how would I show this? Can you please explain a little more?

Thanks again.

Reply With Quote
  #4  
Old January 25th, 2003, 11:01 AM
numbernine numbernine is offline
Up To His Eyes In Ads
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Chicago
Posts: 160 numbernine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 25 sec
Reputation Power: 7
Hi Suzy,
When you have a sale, you would put a single transaction in your Sales table (no matter how many items were part of the transaction.) Then you would take the SalesID that Access generated and put that into your SalesItems table multiple times: one time for each item sold. So each sale would have its own unique number. So your data would look like:

Code:
SALES Table
SalesID     CustomerID
1               7
2               14
3               225

Sales_Items Table
SalesID     ItemID
1               17
1               25
1               14
2               7
3               22
3               22

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Single Transaction


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT