SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast joeyramirez's Avatar
    Join Date
    Nov 2011
    Location
    Cabanatuan City, Philippines
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Generate ID before insert/submit

    I have a form that inserts records, I want first to generate an unique ID before submitting the form and assign it as the ID for the records that I will submit/insert.I am using MySQL for my DB.

  2. #2
    SitePoint Addict
    Join Date
    Apr 2009
    Posts
    357
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Don't use an identity or autonumber column then.

    There are functions that can generate guid's from asp code, google should turn something up for you.

    In most cases it's pretty easy to retrieve the recently created autonumber back to your asp page that did the insert, maybe that would work better for you.
    Doug G
    =====
    "If you ain't the lead dog, the view is always the same - Anon

  3. #3
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is some sample code to generate GUID

    http://www.aspkey.net/aspkey/_blog/i...guid&Submit=Go

  4. #4
    SitePoint Zealot
    Join Date
    May 2009
    Location
    London
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot for the link...as I am searching for the same form last many days.


Bookmarks

Posting Permissions

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