Afficher un message
Vieux 03/10/2007, 12h00   #1
Corey Forman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut ASP Access and Creating an Incremental ID for a record

Alright, I might be making this more difficult than it is, but here goes:
I've currently got a script which will take the number from one field
(ticket_UserID) and a number which is randomly generated (R = CLng (10000 *
Rnd)) and takes the first 4 from the ticket_UserID and the last of the R to
make an 8 digit number. Well now, I want to do the same but not randomly
generated.

I want to add the UserID to an incremental number so I have a logical
tracking method for the tickets entered. Below is what I've got.. hope
someone can !

user_details=split(request("ticket_userid") ,"/")
rs.Open "select * from tickets where ticket_id=0" , connStr, 2, 2
rs.AddNew
rs("ticket_userID") = user_details(0)
rs("ticket_staff") = "N/A"
rs("ticket_unread") = 0
rs("ticket_origin") = "web"
user_details=split(request("ticket_userID") ,"/")
Randomize
R = CLng(10000 * Rnd)
ticketid=user_details(0) & cstr(R)
user_name=user_details(1)
  Réponse avec citation
 
Page generated in 0,06098 seconds with 9 queries