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

 AfterInsert Event - CCStudio

Print topic Send  topic

Author Message
SC
Posted: 06/17/2002, 12:57 AM

I have added some code to the afterinsert event of a record form to add a related record into another table. This all works except that the autoincrement key of the primary form isn't available at the time the afterinsert event is executed (it's on the database).

Is there any way of getting the autoincremented key at this point? I could select max() for it but this would not allow concurrency.

Afterinsert code.
global $wars1,$newwid;
$results_ds = new clsDBLeague();
$sSQL2 = "INSERT INTO results ("
. "sid, "
. "wid, "
. "cid, "
. "pts"
. ") VALUES ( "
. $wars1->ds->ToSQL($wars1->ds->Season->GetDBValue(), $wars1->ds->Season->DataType) . ", "
. $wars1->ds->ToSQL($wars1->ds->wid->GetDBValue(), $wars1->ds->wid->DataType) .","
. $wars1->ds->ToSQL($wars1->ds->Clan1->GetDBValue(), $wars1->ds->Clan1->DataType) . ", "
. $wars1->ds->ToSQL($wars1->ds->cid1pts->GetValue(), $wars1->ds->cid1pts->DataType)
.")";
$results_ds->query($sSQL2);
Nicole
Posted: 06/18/2002, 6:39 AM

Hello,
what db do you use? Please refer to following article:
http://www.gotocode.com/art.asp?art_id=80&
hope it helps

   


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

Web Database

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.