|
-
Mar 8th, 2001, 07:16 AM
#1
Thread Starter
Addicted Member
Hi I want to know an easy way to get data out of a record I have just inserted.
For example at the moment I have a database used for storing orders. When an order is made I run a query which gets a "free" orderID by selecting the highest orderID in the table and adding one. All subsequent queries, functions etc can then use this ID.
However this will take a long time if the table has a large number of records. Also bad things will happen if someone inserts another record in between this process happening and the actual insert. Although I guess I could change the lock type.
Is there a way I can insert a record and have the orderID an autonumber field and then get the orderID of the record inserted.
Hope this makes sense,
Thanks
Alex
ASP, SQL, VB6, Java Script and dubious guitar playing skills.
-
Mar 8th, 2001, 07:33 AM
#2
-
Mar 8th, 2001, 07:37 AM
#3
Thread Starter
Addicted Member
Currently Access 2000 (dont worry it is for a small application).
Alex
ASP, SQL, VB6, Java Script and dubious guitar playing skills.
-
Mar 8th, 2001, 07:54 AM
#4
Hi
Instead of use autonumber you can have a table with a field with orderid (to simulate autonumber).
My 2 cents.
-
Mar 8th, 2001, 10:21 AM
#5
Thread Starter
Addicted Member
I am sorry I dont understand, please explain further.
Thanks,
Alex
ASP, SQL, VB6, Java Script and dubious guitar playing skills.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|