Hi!
You probably have a connection variable,
on which you execute the insert. Use
select @@identity on it:
cnn.execute "your insert....."
set rs=cnn.execute("select @@identity",,adcmdtext)
msgbox rs.fields(0).value
I don't know much about script syntax,
but the above should work in VBA, given
rs is declared as adodb.recordset.
ben.werdmul...@sbs.ox.ac.uk wrote:
Hi,
Is there an easy way in ASP/VBscript to grab an autonumber (primary
key) field just after an SQL insert? This is probably easy, but I'm
stuck ..
Cheers.