1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

ASP - incrementing numbers

Discussion in 'Software Development' started by Seema25, Jan 19, 2002.

Thread Status:
Not open for further replies.
  1. Seema25

    Seema25 Thread Starter

    Dec 18, 2001

    I got a question to be solved. Does anyone know how to write the code to increment the product number and pass it on to the next page, to be added to the database, so the user doesn't have to type it in? Basically, i want to take the last product number from the product page, increment it to the next number (the product number or any id's has to be hidden on the product page), so if the last number in the db is 0012 i want the next number to be 0013, pass it to the addprod page and show it on the form and then have it stored in the db with that particular product - so every product has a unique product number.

    any help would be great

  2. Spu


    Nov 25, 2001
    I don't know if i understand your question (sorry for being stupid). The way i see it is that you want to let your users to add products (insert records) to your database with unique ID numbers, is this right?

    If it is, its a simple operation, especially if your using MM Ultradev.

    What are you writing the script in, ASP, Coldfusion, PHP, etc.? And what database are you using, Access, SQL?
  3. Rockn


    Jul 29, 2001
    If you are writing to an Access db your table should already be set up to have a primary key that will increment every time a new record is added. If it's SQL just do a query that looks for the max and then add 1 to it in the appropriate field.
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/65453

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice