Using @@Identity or Scope_Identity in Access

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
James [ Mi, 30 Januar 2008 20:48 ] [ ID #1919967 ]

RE: Using @@Identity or Scope_Identity in Access

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
Manish [ Mi, 30 Januar 2008 23:30 ] [ ID #1919995 ]

Re: Using @@Identity or Scope_Identity in Access

Last time I used Access, which is a number of years back, there was no
[at] [at] 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" <James [at] discussions.microsoft.com> wrote in message
news:E013BF65-979E-487D-832D-D3D567BD9011 [at] 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
Ray Costanzo [ Do, 31 Januar 2008 01:00 ] [ ID #1920670 ]

Re: Using @@Identity or Scope_Identity in Access

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
> [at] [at] 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" <James [at] discussions.microsoft.com> wrote in message
> news:E013BF65-979E-487D-832D-D3D567BD9011 [at] 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
>
>
>
James [ Do, 31 Januar 2008 10:08 ] [ ID #1920691 ]
Microsoft » microsoft.public.dotnet.framework.aspnet » Using @@Identity or Scope_Identity in Access

Vorheriges Thema: What makes database connection expensive?
Nächstes Thema: Reference required to assembly error