CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 Record Count After Inserting Record In "After-Insert-Event"

Print topic Send  topic

Author Message
garycrunk

Posts: 23
Posted: 12/19/2006, 10:41 AM

[Codecharge Studio ... ASP .. MsAccess Database]

I have a form to Add a record to the database.
In the After-Insert Event of that form, I need to be able to retrieve the Record Number of the record that was just added. I tried:

Session("LastRecord") = MyDatabaseName.DataSource.Recordset.RecordCount

But it doesnt work....

Any ideas on how I can retrieve the Record Number of the record JUST added in the "After-Insert" event on a Record-Add-Form and maybe saving that number in a Session Variable????

Thanks
garycrunk@jobexaminer.com


_________________
Gary Crunk
Job Examiner
View profile  Send private message
Edd


Posts: 547
Posted: 12/19/2006, 1:17 PM

Gary,
There are quite a number of posts on how to retireve the last post, I have always found the most successfull is to use the

Session("LastRecord") = CCDLookup("Max(RecordID)","NameOfTable","",DBConnection)

This ONLY works for low volume databases - but since you are using MSaccess you won't have a problem.

Do a search on this forum and decide which is your best alternative.

Edd
_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message

Add new topic Subscribe to topic   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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