I effectively want to run an UPDATE
command on a table in an Access database (via ADO.NET
) but I want it to run backwards - ie from the last record to the first - to avoid duplicate records with the same 'ID'
.
I tried adding & " ORDER BY ID DESC;"
but this throws an error as its not allowed.
Help!
Thanks Andy
Dim dsxcmd As OleDbCommand
strSelect = "UPDATE Items SET ID=ID+1 WHERE ID>=" & lInsert.ToString
dsxcmd = New OleDbCommand(strSelect, cn)
dsxcmd.ExecuteNonQuery()
dsxcmd.Dispose()