After a user uploads a photo for a gallery, i collect the file name and sort order in an Access database. I have the sort order 0. There are about 60 images in the table. After the new record is added, i want to update the sort order for all the records, making the one i just added the one on top, so i'm using the following code. It updates the record to "1" that i added as 0 and adds 1 to each succeeding record. But the record that is "1" doesn't get updated but all the rest do. so then i have 1, 1, 2, 3, etc. Two number ones. What's up with that? I've been jacking around with this, trying to refresh, even setting up another page to update the sort order separately. Why would it add +1 to all of the records except the original #1? What am i missing? Thanks in advance.
Set rs2 = Server.CreateObject("ADODB.Recordset")
strTableName2 = "xmlContents"
rs2.Open strTableName2 & " WHERE xmlCatid=" & request.querystring("catid") & " order by xmlSortOrder", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable
rs2("xmlSortOrder")=rs2("xmlSortOrder") + 1