Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
strSQL = "SELECT TOP 1 OrderInLine FROM myTable ORDER BY id DESC;"
sql="select top 1 * from table"
rs.Open sql,objCOnn,3,3
rs.AddNew
...
rs.Update
lastID=rs("mytable_id")
'assuming there is a connection string called conn_str
' also assuming the new order value is in Request.Form("newOrder")
Dim conn_obj, newOrder
'grab the newOrder value
newOrder = Request.Form("newOrder")
'create and open the connection
Set conn_obj = Server.Createobject("ADODB.Connection")
conn_obj.Open conn_str
'shift everything down to make room for the new value
conn_obj.Execute "UPDATE MyTable SET OrderInLine = OrderInLine + 1 WHERE OrderInLine >= " & newOrder
'insert new record
conn_obj.Execute "INSERT INTO MyTable(OrderInLine,otherField, anotherField, etc) VALUES(" & newOrder & ",'" & Request.Form("otherField") & "',etc)"
'clean up
conn_obj.Close
Set conn_obj = Nothing