Rosario
Posts: 54
|
| Posted: 01/15/2009, 9:48 AM |
|
I really want to click on a recor and retrive the last table record entered by a user.
The intremental unuqe ID is called "ID" and the username is called ATTUID.
Is there anything I can do here? im using MS access database on the webserver
Thanks
|
 |
 |
Rosario
Posts: 54
|
| Posted: 01/15/2009, 10:03 AM |
|
I did this
-------------------------
Dim LastID
If IsEmpty(Request.QueryString("ID")) Then
LastID = CCDLookup("max(ID)","JOBAID1","ATTUID="&DBMSOC.ToSQL(Request.Form("ATTUID"),"CCText"),DBMSOC)
If InStr(Redirect,"?") = 0 Then
Redirect = Redirect & "?ID=" & LastID
ElseIf Right(Redirect, 1) = "?" Then
Redirect = Redirect & "ID=" & LastID
Else
Redirect = Redirect & "&ID=" & LastID
End If
End IF
'End Custom Code' -------------------------
Using MSACCESS DB and folowing the multiuser reg example, but when this gets redirected to the next page, it dose not seem like the other page picks up the right URL
Http://domainname.com/JOBAID001_maint_Step2.asp?JOBAID1Page=2&ID=
looks like it never did the dip for the last id, seems incompleate
|
 |
 |
MaFi
Posts: 49
|
| Posted: 01/15/2009, 11:57 PM |
|
Hi Rosario,
even with access you can use:
SELECT @@identity AS NewId FROM Tablename
If you insert this in the AfterInsert Event you get the LastId and use it for redirection.
Regards
Martin
|
 |
 |
Rosario
Posts: 54
|
| Posted: 01/16/2009, 6:26 AM |
|
thanks MaFi,
I think there is an issue with syntax though,
Microsoft VBScript compilation error '800a0408'
Invalid character
/ca/JOBAID001_maint_events.asp, line 48
SELECT @@identity AS Id FROM JOBAID1
-------^
|
 |
 |
|