HighTechTalks DotNet Forums  

Next Autonumber Value

Dotnet Framework (ADO.net) microsoft.public.dotnet.framework.adonet


Discuss Next Autonumber Value in the Dotnet Framework (ADO.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Guramrit Singh
 
Posts: n/a

Default Next Autonumber Value - 02-02-2010 , 11:50 PM






Hello Everybody,
I want to get next autonumber(indentity) value for row to be inserted in a
table within a transaction of MS Access, In VB6, I can do the same using
recordset.addnew, and then I was able to get autonumber value before update.
In SQL Server I can do the same using IDENT_CURRENT('table_name') and
IDENT_INCR, but I am unable to do the same in MS Access.


--
Regards,
Guramrit Singh
S/W Developer
LOGIC ERP Solutions Pvt. Ltd.

Reply With Quote
  #2  
Old   
Patrice
 
Posts: n/a

Default Re: Next Autonumber Value - 02-08-2010 , 06:48 AM






Hello,

AFAIK Access uses @@IDENTITY. See :
http://support.microsoft.com/kb/232144/en-us (INFO: Jet OLE DB Provider
Version 4.0 Supports SELECT @@Identity)

--
Patrice

"Guramrit Singh" <guramrit (AT) msn (DOT) com> a écrit dans le message de
news:9D910F2F-0753-44C6-B8A3-427BDA69F33C (AT) microsoft (DOT) com...
Quote:
Hello Everybody,
I want to get next autonumber(indentity) value for row to be inserted in a
table within a transaction of MS Access, In VB6, I can do the same using
recordset.addnew, and then I was able to get autonumber value before
update.
In SQL Server I can do the same using IDENT_CURRENT('table_name') and
IDENT_INCR, but I am unable to do the same in MS Access.


--
Regards,
Guramrit Singh
S/W Developer
LOGIC ERP Solutions Pvt. Ltd.

Reply With Quote
  #3  
Old   
Miro
 
Posts: n/a

Default Re: Next Autonumber Value - 02-23-2010 , 09:57 AM



Quick question.

I was trying this with @@Identity, in a tableadapter and I cannot get this
working.

Im assuming this is not an option with the tableadapter? (you must use it
with manual sql) - I even tried to set the tableadapter query to scalar.

Miro

"Patrice" <http://scribe-en.blogspot.com/> wrote

Quote:
Hello,

AFAIK Access uses @@IDENTITY. See :
http://support.microsoft.com/kb/232144/en-us (INFO: Jet OLE DB Provider
Version 4.0 Supports SELECT @@Identity)

--
Patrice

"Guramrit Singh" <guramrit (AT) msn (DOT) com> a écrit dans le message de
news:9D910F2F-0753-44C6-B8A3-427BDA69F33C (AT) microsoft (DOT) com...
Hello Everybody,
I want to get next autonumber(indentity) value for row to be inserted in
a table within a transaction of MS Access, In VB6, I can do the same
using recordset.addnew, and then I was able to get autonumber value
before update.
In SQL Server I can do the same using IDENT_CURRENT('table_name') and
IDENT_INCR, but I am unable to do the same in MS Access.


--
Regards,
Guramrit Singh
S/W Developer
LOGIC ERP Solutions Pvt. Ltd.

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.