Retrieve ID with VB -
08-22-2006
, 03:41 PM
I have the following code to retrieve the ID once a record is inserted with
the 'insert behaivor' in DW, this is Javascript, but the page where I need
to add it is VB so it doesnt work, perhaps someone can help get this in VB ?
// execute the insert
var MM_editCmd = Server.CreateObject('ADODB.Command');
MM_editCmd.ActiveConnection = MM_editConnection;
MM_editCmd.CommandText = MM_editQuery;
MM_editCmd.Execute();
------ This is where the code goes ---------
<!--set up Auto Number retrieval for SQL Server -->
var rsNewAutoIncrement = MM_editCmd.ActiveConnection.Execute("select
@@identity")
Session("svReq_ID") = rsNewAutoIncrement(0).Value
<!--rsNewAutoIncrement.Close -->
<!--var rsNewAutoIncrement = Nothing -->
<!--end retrieval -->
------------
Any help is greately appreciated !
A |