Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Exclamation What autonumber id did access generate?

    Okay I have a table where it has Autonumber field for one of the id's....

    I'm designing a messaging system right.... is for 6 users. Members of the public are given the choice to send the users of the system mail. When a member of the public sends a message to a user. The message is created and entered into the "userMessage" table which stores the message id, header, date, body so on.... then i need the message id to put it in the "userInbox" the table that stores username and the message id. This table tells exactly what is in each user's inbox.

    So how do i get the message id that the autonumber created without using another SELECT statement which I think is gonna be extremely inefficient, because what would I put for the where clause? all the other data?

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    478
    Thanks
    0
    Thanked 2 Times in 2 Posts
    4GuysFromRolla.com : ASP FAQS : Databases, General
    How do I get the record number of a just added record, using an Access database table? by Bill Wilkinson - 11/3/2000
    http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=79

    ADO FAQ - Q9) How do I get the AutoNumber (or Identity) for a newly inserted record?
    http://www.able-consulting.com/ADO_Faq.htm#Q9

    INFO: Identity and Auto-Increment Fields in ADO 2.1 and Beyond
    http://support.microsoft.com/support.../q233/2/99.ASP

    INFO: Identity (AutoIncrement) Columns in ADO or RDS
    http://support.microsoft.com/support.../q195/9/10.asp

    User Tips: Getting the ID of the Just Inserted Database Record by Dan H. - 12/26/2000
    http://www.4guysfromrolla.com/webtec...122600-1.shtml
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips

  • #3
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Those sites were extremely helpful thanks man!


  •  

    Posting Permissions

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