Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Generating the next sequential key...

Re: Generating the next sequential key...

From: Lyle Fairfield <lylefairfield_at_aim.com>
Date: 2 May 2006 05:13:56 -0700
Message-ID: <1146572036.360259.142980@y43g2000cwc.googlegroups.com>


timasmith_at_hotmail.com wrote:

> Please correct me if MSAccess has progressed beyond that.

Sub temp()
Dim c As ADODB.Connection
Set c = New ADODB.Connection
With c

.ConnectionString = CurrentProject.BaseConnectionString
.Open
.Execute "INSERT INTO [Order Details] " _
& "(OrderID, ProductID, UnitPrice, Quantity, Discount) " _ & "Values (12, 23, 15.5, 12, 3/1000)"
Debug.Print .Execute("SELECT @@Identity").Collect(0) ' prints the autonumber of the newly inserted record .Close
End With
Set c = Nothing
End Sub Received on Tue May 02 2006 - 07:13:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US