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