Connecting Tech Pros Worldwide Forums | Help | Site Map

Help for Access Temp Database

Thunder
Guest
 
Posts: n/a
#1: Nov 12 '05
Hi,
I'm building an ecommerce website. When a user logs into my site, I want to
create a temporary table (say called 'ShoppingCart') in my database. I'm
currently using MS Access, but may use SQL in the future. Since I cannot
create a temporary table in Access, I want to create the table and then
delete it (drop it) at the end of the session.

My question: If I call the table 'ShoppingCart', for example, will this
create a problem if multiple users simultaneously access the website and
have their own temporary table called 'ShoppingCart'? ...or do I need to
figure out some way to give the tablename a unique name for each user? Any
suggestions doing this would be appreciated.

Also, what is the best way to delete the table at the end of the user
session? I
am using ASP VBscript. Thanks.



Pavel Romashkin
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Help for Access Temp Database


I would expect severe problems if the web site you are developing would
ever start selling well. Creating temp tables in a file server system
even for 30 simultaneous users! Others will correct me if I'm wrong, but
using an Access db is not optimal here.

Pavel

Thunder wrote:[color=blue]
>
> Hi,
> I'm building an ecommerce website. When a user logs into my site, I want to
> create a temporary table (say called 'ShoppingCart') in my database. I'm
> currently using MS Access, but may use SQL in the future. Since I cannot
> create a temporary table in Access, I want to create the table and then
> delete it (drop it) at the end of the session.
>
> My question: If I call the table 'ShoppingCart', for example, will this
> create a problem if multiple users simultaneously access the website and
> have their own temporary table called 'ShoppingCart'? ...or do I need to
> figure out some way to give the tablename a unique name for each user? Any
> suggestions doing this would be appreciated.
>
> Also, what is the best way to delete the table at the end of the user
> session? I
> am using ASP VBscript. Thanks.[/color]
MGFoster
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Help for Access Temp Database


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It would be easier to have one ShoppingCart table for ALL shoppers and
give a unique ID for each shopper. E.g.:

Table: ShoppingCart
Fields:
ShopperID Long (AutoNumber or something else?)
ItemID Long -- the product
Qty Integer -- how many requested

Then when the transaction is complete/cancelled, the records for that
shopper would be transferred to the Order table/deleted.

I'm not sure if you can Delete from VBScript - probably only if it is
a server-side command.

HTH,

MGFoster:::mgf
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP75Jr4echKqOuFEgEQLUHwCgnyKo/HVtp9JpIrlfcKMDs4R1k7oAoJx2
CUbCEWTinYJbRIrpUYKBuFyz
=7ptb
-----END PGP SIGNATURE-----


Thunder wrote:
[color=blue]
> Hi,
> I'm building an ecommerce website. When a user logs into my site, I want to
> create a temporary table (say called 'ShoppingCart') in my database. I'm
> currently using MS Access, but may use SQL in the future. Since I cannot
> create a temporary table in Access, I want to create the table and then
> delete it (drop it) at the end of the session.
>
> My question: If I call the table 'ShoppingCart', for example, will this
> create a problem if multiple users simultaneously access the website and
> have their own temporary table called 'ShoppingCart'? ...or do I need to
> figure out some way to give the tablename a unique name for each user? Any
> suggestions doing this would be appreciated.
>
> Also, what is the best way to delete the table at the end of the user
> session? I
> am using ASP VBscript. Thanks.
>
>[/color]


Andy
Guest
 
Posts: n/a
#4: Nov 12 '05

re: Help for Access Temp Database


Your best bet here is to add two fields to the order table
isOrder - Boolean(Yes/No)
DateStamp - Date/Time

then set the DateStamp default value to Date()

When a user starts a shopping cart the DateStamp field would be the date.
If the user places an order, the set the isOrder field to true.

Call a script for every user that starts a Shopping Cart that deletes all
orders that are older than 1-day or whatever you decide.
Example:

Set ShoppingCart = "Select * From OrderTable Where DateStamp > (Date() + 1)
and isOrder = False"
Do Until ShoppingCart.eof = True
With ShoppingCart
..delete
End With
ShoppingCart.MoveNext
Loop

Good Luck
--
Andy Austin



"Thunder" <discodog1@pacbell.net> wrote in message
news:eJqvb.11749$kQ1.1665@newssvr13.news.prodigy.c om...
Hi,
I'm building an ecommerce website. When a user logs into my site, I want to
create a temporary table (say called 'ShoppingCart') in my database. I'm
currently using MS Access, but may use SQL in the future. Since I cannot
create a temporary table in Access, I want to create the table and then
delete it (drop it) at the end of the session.

My question: If I call the table 'ShoppingCart', for example, will this
create a problem if multiple users simultaneously access the website and
have their own temporary table called 'ShoppingCart'? ...or do I need to
figure out some way to give the tablename a unique name for each user? Any
suggestions doing this would be appreciated.

Also, what is the best way to delete the table at the end of the user
session? I
am using ASP VBscript. Thanks.



Closed Thread