Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 ASP Insert to table with 1 autonumber field
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 22 September 2004 :  05:23:01  Show Profile  Visit D3mon's Homepage
What query (in MS Access 2000) might I use to create a new record in a table which has only one field, which is an autonumber?


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 22 September 2004 :  06:06:33  Show Profile
I dunno. Never tried that before. Maybe inserting 0 into the auto_number field? Don't know if that will give you an error. Probably will.

You might have to create a second column that accepts nulls, and just insert null values into it.

Support Snitz Forums
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 22 September 2004 :  07:01:28  Show Profile  Send ruirib a Yahoo! Message
May I ask why would you need that? Sorry to say, but that situation seems to indicate an issue with the model on which the table was based...


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

miperez
Junior Member

Spain
243 Posts

Posted - 22 September 2004 :  07:35:22  Show Profile
I was also wondering. The only possible use I can find is to use that table as a counter, but I'd rather use an integer value in a table.

Best Regards

Mikel Perez

"Hell is the place where everything test perfectly, and nothing works"
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 22 September 2004 :  07:44:10  Show Profile  Send pdrg a Yahoo! Message
Hey D3mon, what's the plan? It does sound like a 'wouldn't start from here' question, so I think we'd all be keen to see what it is you're planning to do, and then maybe advise a bit better?
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 22 September 2004 :  08:13:18  Show Profile  Visit D3mon's Homepage
the table just holds a basketID, then another table, basketItems has a foreign key, basketID for each item in a basket


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 22 September 2004 :  09:11:59  Show Profile  Send ruirib a Yahoo! Message
Hmm... and don't you need to relate this basket to some user? How do you handle that?


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 22 September 2004 :  09:47:35  Show Profile  Visit D3mon's Homepage
the basketID is stored as a session var, the site doesn't have registered users.


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 22 September 2004 :  11:38:35  Show Profile  Send pdrg a Yahoo! Message
so really you could just dump the 1-col table and just enter the FK field from the session var? No need to relate anything this way, and you can just select blah from [onetable] where [fkfield]=[mysessionvariable]. You could even use the sessionID as the identifier, so it will be nice and unique :)

just my thoughts
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 22 September 2004 :  13:04:20  Show Profile  Send ruirib a Yahoo! Message
You can also add another meaningful field, such as date/time for the basket creation, so that you can simply add a new record to the table.

Although I must say that using the session ID would probably be a wise choice to represent the session. The best models are the ones that match the reality being modeled... and there is nothing better to represent a session than the session id.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 22 September 2004 :  15:59:13  Show Profile  Visit D3mon's Homepage
killed two birds with one stone and decided to add a yes/no field to indicate that the basket has been paid for. Sorted. Thanks guys.


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.56 seconds. Powered By: Snitz Forums 2000 Version 3.4.07