If this is known, then it's fine to add and accept an answer stating there is no answer, and why, under what conditions, etc.
If this is not known, there's really no choice but to leave the question open and use one of the aformentioned methods to draw attention to the question in the hope that someone will be able to offer a bit of help.
- The question as written is unanswerable and unsalvageable
These types of questions are normally closed off quickly, so anything that's totally unanswerable won't remain in the system. Those few that get through will just end up abandoned... there's really nothing else that can be done with them unless they get cleaned up by the original author.
- There may be a technically correct answer, but the asker is unable to utilize it for some reason.
Since there's a correct solution that would work for others, it's fine to accept the answer even if it didn't solve the original specific problem.
Most of the time in this case, the technically correct answer will lead to another solution, or another approach to the problem entirely. At that point, if the author needs help, it would be better to start a new question with a reference to the first one stating why that solution doesn't work in this situation, and repeat this whole process.