After adding a record using the addnew method in asp, we often use the auto-incrementing ID, and bookmark can easily implement this function.
Copy codeThe Code is as follows: rs. open SQL, conn, 3,3
Rs. addnew
Rs ("user") = "Tom"
Rs ("pass") = "333333"
Rs. update
Temp = rs. bookmark
Rs. bookmark = temp
Response. write rs ("ID ")
Access returns the added auto-incrementing ID.
Used in aspCopy codeThe Code is as follows: objRs. AddNew
ObjRs. Update
If you do not know how to return the child-incrementing ID in. net,
UseCopy codeThe Code is as follows: select @ identity
This is only available in SQL.
I can't help it later,
In this way:
1. Add a record first.
2. Get max (id)
3. modify data according to max (id)
It's really troublesome ~~ Concurrency estimation is also a problem. I don't know how to implement it?
You have a strange saying. To obtain the auto-incrementing ID is to query the SQL statement.
In addition, ASP can also be implemented using pointers .. Net does not know.
In fact, the meaning of the landlord is "select @ identity" only available in sqlserver.