Using @@Identity or Scope_Identity in Access

Using @@Identity or Scope_Identity in Access

am 30.01.2008 20:48:01 von James

Hello

Can this be done? If so how? I have seen some articles saying it can but
they are from 1999 and the code no longer works. Or is there another way of
getting the primary key for the record just inserted?

Thanks
James

RE: Using @@Identity or Scope_Identity in Access

am 30.01.2008 23:30:02 von Manish

Hi James,

you can set the DataType for a Number field as AutoNumber.

Regards,
Manish
www.ComponentOne.com

"James" wrote:

> Hello
>
> Can this be done? If so how? I have seen some articles saying it can but
> they are from 1999 and the code no longer works. Or is there another way of
> getting the primary key for the record just inserted?
>
> Thanks
> James

Re: Using @@Identity or Scope_Identity in Access

am 31.01.2008 01:00:11 von Ray Costanzo

Last time I used Access, which is a number of years back, there was no
@@identity concept still. In the days of classic ASP, one of the ways to do
this in a 100% reliable way was to use a clinky recordset object, set the
values, and insert it. You'd still have that connected recordset available,
and could then read the ID column from that same record. Similar logic
could be applied with ADO.Net, I'd imagine.

Ray at home


"James" wrote in message
news:E013BF65-979E-487D-832D-D3D567BD9011@microsoft.com...
> Hello
>
> Can this be done? If so how? I have seen some articles saying it can but
> they are from 1999 and the code no longer works. Or is there another way
> of
> getting the primary key for the record just inserted?
>
> Thanks
> James

Re: Using @@Identity or Scope_Identity in Access

am 31.01.2008 10:08:01 von James

Hi

Thanks for your response, do you have an example or a link to where I could
get one? Im trying to insert Firstname, Lastname, Email, and the autonumber
is memberID.

Many thanks
James

"Ray Costanzo" wrote:

> Last time I used Access, which is a number of years back, there was no
> @@identity concept still. In the days of classic ASP, one of the ways to do
> this in a 100% reliable way was to use a clinky recordset object, set the
> values, and insert it. You'd still have that connected recordset available,
> and could then read the ID column from that same record. Similar logic
> could be applied with ADO.Net, I'd imagine.
>
> Ray at home
>
>
> "James" wrote in message
> news:E013BF65-979E-487D-832D-D3D567BD9011@microsoft.com...
> > Hello
> >
> > Can this be done? If so how? I have seen some articles saying it can but
> > they are from 1999 and the code no longer works. Or is there another way
> > of
> > getting the primary key for the record just inserted?
> >
> > Thanks
> > James
>
>
>