CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Last ID

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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
-------^
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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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