getting identity field
hey guys wanted to know if anyone can help me
i just added a set of items using the addnew property
and i want to get the autonumber/identity field of the inputed record.
i tried calling it after the update statement with no luck
any clues on why its not picking up the value?
kj
strSQL ="SELECT * FROM SHPRULE"
Set objConn = Server.CreateObject("ADODB.Connection")
Set objCmd = Server.CreateObject("ADODB.Command")
Set objRS = Server.CreateObject("ADODB.Recordset")
objConn.Open strConnString
objCmd.ActiveConnection = objConn
objCmd.CommandText = strSQL
'-- Cursor Type, Lock Type
'-- ForwardOnly 0 - ReadOnly 1
'-- KeySet 1 - Pessimistic 2
'-- Dynamic 2 - Optimistic 3
'-- Static 3 - BatchOptimistic 4
objRS.Open objCmd, , 3, 3
objRS.Addnew
objRS.Fields("SRNAME") = request("field01")
objRS.Fields("MIN") = request("field03")
objRS.Fields("MAX") = request("field04")
objRS.Fields("SHPAMT") = request("field05")
objRS.Fields("SUPER") = request("field07")
objRS.Fields("PRIORITY") = request("field08")
objRS.Fields("SHPMETH") = request("field02")
objRS.Update
response.write objRS("SHPRULEID")
|