...

View Full Version : What autonumber id did access generate?



jaywhy13
01-11-2005, 10:40 PM
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. :confused:

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?
:eek: :eek:

Bullschmidt
01-12-2005, 05:02 AM
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/kb/articles/q233/2/99.ASP

INFO: Identity (AutoIncrement) Columns in ADO or RDS
http://support.microsoft.com/support/kb/articles/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/webtech/tips/t122600-1.shtml

jaywhy13
01-13-2005, 06:38 AM
Those sites were extremely helpful thanks man!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum