Warning: This is a nit-pick and may not affect memory/performance off the app. I just like doing as little as possible in a loop (including variable declarations), since I've been raised on a "loops are expensive" mindset.
Also use parameterized queries (which you may already have, if you switched to batching). Every time you do this
sSQL = "UPDATE [IS_SYSTEM].dbo.devices_hello " & _
"SET " & _
"active_user = '', " & _
"active = 0, " & _
"last_user = '" & pubID & "', " & _
"last_user_exitcode = 2 " & _
"WHERE device_id = '" & devID & "'"
you are creating a new string. For small loops, this may be a non-issue. But since you seem to worry about memory constraints, this can add up (the garbage collector will take care of all those strings, but then you are putting more work on the garbage collector, which could impact performance). Please note this is a nit-pick and I'm only pointing it out since you seem to worry about memory usage.