CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 lastpk in CCStudio

Print topic Send  topic

Author Message
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

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.