|
 |
asp_databases thread: Max Record ID
Message #1 by "Patrick Sullivan" <pat@s...> on Tue, 26 Feb 2002 10:24:40 -0600
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01C1BEAF.CCE66510
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Hey Everyone, I am having a problem. I have a project manager thing that
I use to track projects at work. It's a simple access database with an
ASP front end. When I add a project I need to get the Project_ID for
that project back to do some other functions. If I run a Select
Max(Project_ID) type query it returns the Max of the table BEFORE the
insert, not after. Since this is an identity column I can't just add one
to that result. I remember reading something about this before I just
can't remember where I read it. I'm used to using stored procedures in
sql server to do this kind of thing. Is there something that I can do
for this? Do I have to close and re-open my connection object?
Pat
pat@s...
Message #2 by "Peter Foti (PeterF)" <PeterF@S...> on Tue, 26 Feb 2002 11:32:33 -0500
|
|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------ =_NextPart_001_01C1BEE3.312A2510
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
This article explains how to do it. :)
=A0
http://www.adopenstatic.com/experiments/fastestautonumber.asp
=A0
Regards,
Pete
-----Original Message-----
From: Patrick Sullivan [mailto:pat@s...]
Sent: Tuesday, February 26, 2002 11:25 AM
To: ASP Databases
Subject: [asp_databases] Max Record ID
Hey Everyone, I am having a problem. I have a project manager thing
that
I use to track projects at work. It's a simple access database with an
ASP front end. When I add a project I need to get the Project_ID for
that project back to do some other functions. If I run a Select
Max(Project_ID) type query it returns the Max of the table BEFORE the
insert, not after. Since this is an identity column I can't just add
one
to that result. I remember reading something about this before I just
can't remember where I read it. I'm used to using stored procedures in
sql server to do this kind of thing. Is there something that I can do
for this? Do I have to close and re-open my connection object?
=A0
Pat
pat@s...
=A0
$subst('Email.Unsub').
Message #3 by "Patrick Sullivan" <pat@s...> on Wed, 27 Feb 2002 16:55:59
|
|
Thanks Pete! That looks to be what I need.
|
|
 |