Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Glen Villar
  Where is Glen Villar?
 Palayan City
 Philippines
 Glen Villar
 To: David Mustakim
  Where is David Mustakim?
 Jakarta
 Indonesia
 David Mustakim
 Tags
Subject: RE: Get the last id in MS access
Thread ID: 393661 Message ID: 393747 # Views: 35 # Ratings: 0
Version: Visual FoxPro 9 Category: Windows 7 and VFP
Date: Monday, December 23, 2013 2:11:20 AM         
   


> >
> >
> > SELECT @@IDENTITY;
> >
> > My respects
>
>
>
> I don't use Access but elaboration would be much appreciated Vilhelm - TIA
>
> David

Hi David,

If a table in MS Access uses a field with an "AutoNumber" data type, Vilhelm-Ion is right,
the last autoinc number can be retrieved using @@identity after a successful insert, much
like what we do in SQL Server.

Otherwise, if it's an ordinary number field, then Ali's answer is okay too, I think.




My blog: http://thereportersassistant.blogspot.com

ENTIRE THREAD

Get the last id in MS access Posted by JAVA 4ever @ 12/21/2013 6:39:54 AM
RE: Get the last id in MS access Posted by Ali Koumaiha @ 12/21/2013 3:40:39 PM
RE: Get the last id in MS access Posted by Vilhelm-Ion Praisach @ 12/22/2013 8:56:09 PM
RE: Get the last id in MS access Posted by David Mustakim @ 12/22/2013 9:05:13 PM
RE: Get the last id in MS access Posted by Glen Villar @ 12/23/2013 2:11:20 AM
RE: Get the last id in MS access Posted by Vilhelm-Ion Praisach @ 12/23/2013 5:46:22 AM
RE: Get the last id in MS access Posted by David Mustakim @ 12/23/2013 5:52:25 AM