Margaret
|
| Posted: 05/22/2003, 10:30 AM |
|
Does anyone know how and where to put the code in code charge studio to achieve the last primary key
I use asp with templates.
pkSQL = "select max(quoteID) as lastpk from partdetail"
openrs rs, pkSQL
last = GetValue(rs, "lastpk")
session("lastpk") = last
|
|
|
 |
rrodgers
|
| Posted: 05/22/2003, 11:07 AM |
|
I put it in the Record after execute insert event.
In this event you can (if your db supports it, and you are using it) use the @@Identity to return the last inserted record for this connection
Here is some ASP Code I use.
Set rsIdent = DBwsbdc.Execute("SELECT @@IDENTITY As intIdent")
If Not rsIdent.EOF Then
NewIdent = CCGetValue(rsIdent,"intIdent")
End IF
|
|
|
 |
|