You could also have a key field (using a relatively random number in VB)
which you can generate before you do the insert so you can track the change,
and a soon as you have inserted, do a select on the key field, get the ID,
then set the keyfield to zero.
[EMAIL PROTECTED]
-------------------------------------------------------
"Life must be lived as play."
- Plato (427 - 347 BC)
----- Original Message -----
From: "Michael Elfial" <[EMAIL PROTECTED]>
To: "ActiveServerPages" <[EMAIL PROTECTED]>
Sent: Monday, August 19, 2002 11:18 AM
Subject: RE: Getting last ID from an INSERT into an Access database
> Or just use
> recordset.Open ...
> recordset AddNew
> recordset("field").Value = something
> ...
> recordset.Update
> ID = recordset("TheIDField").Value
>
>
>
> -----Original Message-----
> From: Nick Middleweek [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, August 18, 2002 9:38 PM
> To: ActiveServerPages
> Subject: Getting last ID from an INSERT into an Access database
>
>
> Hello,
>
> What is the best way to get the value of the unique ID field from an
Access
> database using ADO/SQL after INSERTing a new record.
>
> Does IDENTITY exist in Access?
>
>
> Thanks,
> Nick
>
>
> ---
> You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
> To unsubscribe send a blank email to
> %%email.unsub%%
>
>
> ---
> You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
> To unsubscribe send a blank email to
%%email.unsub%%
>
>
---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]