When you add a record using the AddNew method in ASP, we often use an incremented ID, which is easy to implement with a bookmark.
Copy Code code as follows:
Rs.Open sql,conn,3,3
Rs.addnew
RS ("user") = "young Man"
RS ("pass") = "333333"
Rs.update
temp = Rs.bookmark
Rs.bookmark = Temp
Response.Write rs ("ID")
Access returns the added self-incrementing ID
Used in the ASP
Copy Code code as follows:
Objrs.addnew
Objrs.update
Instead of knowing how to return the child increment ID in. NET,
Use
Copy Code code as follows:
SELECT @ @identity
This thing is only SQL.
Then I couldn't figure it out,
This comes:
1, first add a record.
2, get Max (ID)
3. Modify data according to Max (ID)
What a trouble ah ~ ~ Concurrency estimates also have problems, do not know how to achieve it?
That's a strange remark you have to say. Getting the self increment ID is inherently querying SQL.
In addition, ASP can also use pointers to achieve. NET does not know.
In fact, the landlord's meaning select @ @identity only SQL Server only