Has anyone been successful getting @@IDENTITY to work with Access 2000? I've
not been successful.
Thanks,
Mick Ruthven
No success here either. The ASP workarounds I've had to construct to get
around this are particularly unpleasant. :-(
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\database.mdb"
Set cnDatabase = Server.CreateObject("ADODB.Connection")
cnDatabase.Open strConn
'Set a variable to your hand coded SQL Insert string
' or to the one created by the MM_Insert behavior
' and remove the MM code that does the actual Insert
strSQL = "Your SQL Insert statement string"
' or strSQL = MM_insertStr
'Insert the record
cnDatabase.Execute strSQL
'retrieve the autonumber for the record just inserted
strSQL = "SELECT @@Identity"
Set rsNewAutoIncrement = Server.CreateObject("ADODB.Recordset")
rsNewAutoIncrement.Open strSQL, cnDatabase
varAutoIDValue = rsNewAutoIncrement(0).Value
'clean things up
rsNewAutoIncrement.Close
Set rsNewAutoIncrement = Nothing
cnDatabase.Close
Set cnDatabase = Nothing
--
Rod Pitts
"Mick Ruthven" <m...@impact-consult.com> wrote in message
news:911ka0$mii$1...@misc.macromedia.com...
Mick Ruthven
"Rod Pitts" <keyl...@hotmail.com> wrote in message
news:912lio$b6q$1...@misc.macromedia.com...
Cheers, .....Nick Pelling.....