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_01C042D8.FFE43320
Content-Type: text/plain;
charset="iso-8859-1"
This will work as long as another user doesn't insert a record in the time
it takes to insert and then select. You may be able to wrap them in a
cftransaction to prevent this, I'm not sure:
<cfquery name="insertRecord" datasource="#mydsn#">
insert into table(name)
values('#form.name#')
</cfquery>
<cfquery name="getMax" datasource="#mydsn#">
select max(tableID) as maxTableID
from table
</cfquery>
<cfset tableID = getMax.maxTableID>
HTH,
Matt
-----Original Message-----
From: Dan [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 30, 2000 6:25 PM
To: CF-Server
Subject: Record ID
Hi, Can anyone help me identify the Record ID of a record that was just
CFINSERTed into an Access Database where RecordID is an Autonumber field?
I've tried cfquery the table using a date&time variable (Where
DateCreated='#Form.DateCreated#') to get the ID but the form date is
different than the date coming back from Access.
Maybe I shouldn't be using AutoNumbers but setting up a control counter
instead.
This has to be a pretty simple task.
----------------------------------------------------------------------------
--
To unsubscribe, send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body or visit the list page at www.houseoffusion.com
------_=_NextPart_001_01C042D8.FFE43320
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>RE: Record ID</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>This will work as long as another user doesn't insert =
a record in the time it takes to insert and then select. You may =
be able to wrap them in a cftransaction to prevent this, I'm not =
sure:</FONT></P>
<P><FONT SIZE=3D2><cfquery name=3D"insertRecord" =
datasource=3D"#mydsn#"></FONT>
<BR> <FONT SIZE=3D2>insert =
into table(name)</FONT>
<BR> <FONT =
SIZE=3D2>values('#form.name#')</FONT>
<BR><FONT SIZE=3D2></cfquery></FONT>
</P>
<P><FONT SIZE=3D2><cfquery name=3D"getMax" =
datasource=3D"#mydsn#"></FONT>
<BR> <FONT SIZE=3D2>select =
max(tableID) as maxTableID</FONT>
<BR> <FONT SIZE=3D2>from =
table</FONT>
<BR><FONT SIZE=3D2></cfquery></FONT>
</P>
<P><FONT SIZE=3D2><cfset tableID =3D getMax.maxTableID></FONT>
</P>
<P><FONT SIZE=3D2>HTH,</FONT>
<BR><FONT SIZE=3D2>Matt</FONT>
</P>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Dan [<A =
HREF=3D"mailto:[EMAIL PROTECTED]">mailto:dsmith@USSBattleshipNJ=
.com</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Monday, October 30, 2000 6:25 PM</FONT>
<BR><FONT SIZE=3D2>To: CF-Server</FONT>
<BR><FONT SIZE=3D2>Subject: Record ID</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Hi, Can anyone help me identify the Record ID =
of a record that was just</FONT>
<BR><FONT SIZE=3D2>CFINSERTed into an Access Database where RecordID is =
an Autonumber field?</FONT>
</P>
<P><FONT SIZE=3D2>I've tried cfquery the table using a date&time =
variable (Where</FONT>
<BR><FONT SIZE=3D2>DateCreated=3D'#Form.DateCreated#') to get the ID =
but the form date is</FONT>
<BR><FONT SIZE=3D2>different than the date coming back from =
Access.</FONT>
</P>
<P><FONT SIZE=3D2>Maybe I shouldn't be using AutoNumbers but setting up =
a control counter</FONT>
<BR><FONT SIZE=3D2>instead.</FONT>
</P>
<P><FONT SIZE=3D2>This has to be a pretty simple task.</FONT>
</P>
<P><FONT =
SIZE=3D2>---------------------------------------------------------------=
---------------</FONT>
<BR><FONT SIZE=3D2>To unsubscribe, send a message to =
[EMAIL PROTECTED] with 'unsubscribe' in the body or =
visit the list page at www.houseoffusion.com</FONT></P>
</BODY>
</HTML>
------_=_NextPart_001_01C042D8.FFE43320--
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body or visit the list page at www.houseoffusion.com