Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 566
  • Last Modified:

How to generate unique ID numbers/characters in Javascript

I have a submission form where users enter and submit information. I want to automatically generate a unique ID/tracking number for each submission (duplicate ID/tracking numbers cannot happen).  

What is the best recommend option for my request?  Can Javascript give me a unique ID for each submission?  Or is it better to give the record ID (in Access) as the ID/tracking number to the submitter? And if so, how do I extract the ID from Access?

Any suggestions is greatly appreciated.  Thank you.
0
arendt73
Asked:
arendt73
1 Solution
 
hieloCommented:
>>What is the best recommend option for my request?  
Use the auto generated number from the db

>>Can Javascript give me a unique ID for each submission?
This would not be reliable

>>Or is it better to give the record ID (in Access) as the ID/tracking number to the submitter?
Yes

>>And if so, how do I extract the ID from Access?
Do an insert of the data. AS soon as you have inserted the data do the following select query:
SELECT @@identity

Details here:
http://www.mikesdotnetting.com/Article/54/Getting-the-identity-of-the-most-recently-added-record
0
 
Saqib KhanSenior DeveloperCommented:
I dont think @@Identity can work for Access.

Set a Column in Access Table to ID and datatype "autonumber". this column will automaticaly create unique number for you. then whenever you make an entry to this table une this trick to retrieve the newly created unique number:

http://www.kamath.com/tutorials/tut004_autonum.asp
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now