.::: Any1 help on unique id& forms? :::.

Results 1 to 2 of 2

Thread: .::: Any1 help on unique id& forms? :::.

  1. #1
    Join Date
    Dec 1969

    Default .::: Any1 help on unique id& forms? :::.

    Hi all,<BR><BR>I am trying to design an ASP form which will register a user and put the details in a database.<BR><BR>The database i am using is Oracle and i need a unique number identifier stored for each user so i can use this number and reference it with other tables, acting as a foreign key.<BR><BR>I have created a sequence in oracle to assign unique numbers.<BR>but you have to type in for the value (sID.NextVal,..etc)<BR>The prob is from an ASP form filling out:<BR>name<BR>email addy<BR>password<BR>login name<BR>how do store unique numbers for each user to the oracle database as you cant get the user to type in a unique identifier?<BR>Also should i ditch oracle and just use Access? cause i know its easier.<BR>i hope this makes sense.<BR>Please help, i&#039;m getting no where on this proj :-(<BR>thx in advance.<BR>AL

  2. #2
    Join Date
    Dec 1969

    Default Easy in Access...

    ...see the ASPFAQs and the question about "AddNew".<BR><BR>I dunno how you specify a "COUNTER" field in Oracle. <BR><BR>If you can&#039;t do so, then here&#039;s an ugly hack. Don&#039;t use it for a busy site, but...<BR><BR>&#060;%<BR>Application.Lock<BR>Set RS = yourConn.Execute( "SELECT Max(id) FROM table")<BR>newID = RS(0) + 1<BR>RS.Close<BR>yourConn.Execute("INSERT INTO table (id,...) VALUES(" & newID & "... )" )<BR>Application.UnLock<BR>%&#062;<BR><BR>The lock/unlock ensure that only one person can do this at a time, so it is thus "safe".<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts