Hi,
To get the last record you have 2 method.
1�) use the "order by" in the sql and order for the ID field in DESC mode, so the first record will be the record you find. In this case you must also put the "TOP 1" parameters in the select. The result query must be: SELECT TOP 1 YourTable.* from YourTable ORDER BY ID DESC this will give you the last record.
2�)Insert an hidden field in the form like <input type=hidden name=sessionId value="<%=session.sessionId%>" > Insert a Field in the DB and call this field SessionId In the insert behavior put the value of the sessionId form field in the sessionId DB field. Create the query to get the field like: "SELECT TOP 1 YourTable.* from YourTable where SessionId = '" & session.sessionId & "' ORDER BY ID DESC" This is a method more sure because if there are 2 user that create the record in the same time with the second you will be sure to get the right record.
Gianluigi
|
|
|