get autonumber column value

  • Thread starter Thread starter Reddy
  • Start date Start date
R

Reddy

Hi,

I am inserting records into a table having a autonumber column(ID) as
primary key. I get the value of ID by using select Max(ID) from table. Is
there any way to retieve the value immediately after inserting the record
without another query (like in ado). Any tutorials with example would be
great

Thanks

Srinivas
 
Srinivas,
This depends on the type of database used. See
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconretrievingi
dentityorautonumbervalues.htm
in the VS.NET help files on "Retreiving Identity or Autonumber Values" (or
search for this in MSDN online).

Ron Allen
 
¤ Hi,
¤
¤ I am inserting records into a table having a autonumber column(ID) as
¤ primary key. I get the value of ID by using select Max(ID) from table. Is
¤ there any way to retieve the value immediately after inserting the record
¤ without another query (like in ado). Any tutorials with example would be
¤ great

No, it requires a bit of effort.

http://longhorn.msdn.microsoft.com/lhsdk/ndp/cpconretrievingidentityorautonumbervalues.aspx


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top