Home | Advertising Info9 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Monday, May 06, 2024  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - Database Issues
 PowerASP Code Help Area : Classic ASP - Database Issues
Subject Info: Retrieving ID from newly inserted data A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
chrscote
Newbie
Newbie


Joined: June/01/2005
Online Status: Offline
Info: 3
Added: June/02/2005 at 9:21am | IP Logged Quote chrscote

I am using Access and would like to be able to get the AutoNumber ID for a record that I add using an INSERT statement.  I've tried using:

SELECT @@IDENTITY 'id' INSERT INTO table (column1,column2) VALUES ('val1','val2')

as well as

INSERT INTO table (column1,column2) VALUES ('val1','val2'); SELECT @@IDENTITY

but each time, I get an error.  Is there a way to get the ID from a newly inserted record at the time when you perform the insert?
I know I could use a couple of sql queries, one after another, but this could cause problems if more than one person inserts data at once.

Chris

Back to Top View chrscote's Profile Search for other info by chrscote
 
firas_TheGeek
Newbie
Newbie
Avatar

Joined: May/27/2006
Location: Oman
Online Status: Offline
Info: 28
Added: May/27/2006 at 8:55am | IP Logged Quote firas_TheGeek

check my post here about this issue

http://www.powerasp.com/code/moreinfo169-1.htm

 

Regards

 



__________________
Firas S Assaad (TheGeek)
firas489@gmail.com
0096892166434
http://firas-thegeek.blogspot.com
Back to Top View firas_TheGeek's Profile Search for other info by firas_TheGeek Visit firas_TheGeek's Homepage
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2024 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP ASP.NET .aspx .ascx Web HTML Developer Internet Microsoft Web Services Visual Studio .NET CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com