Last week I published a post arguing against blindly optimistic encouragement ("If I can do it, you can do it too!"). Of course it's nice to hear someone tell you that you can do it and that all you have to do is keep going and eventually you will succeed, but if determination was all that was needed, then there wouldn't be so many students in such a mess.
People often say, "a PhD is a marathon", but in a marathon the course is laid out for you. No matter how much it hurts, as long as you keep moving along that course then you will eventually finish. A PhD is not a marathon; there is no set course and it is not enough to just keep putting one foot in front of the other, especially if you don't know where you're going.
Determination is a multiplier of success. If your approach is working, then more determination will help you succeed. But if you're working hard and you're constantly stressed and nothing is going to plan, there could be fundamental problems in the way you're approaching the work. In that case, more determination or resilience or motivation to keep doing the same things isn't going to help. Adaptability is sometimes more important. When things aren't working, you need to look at what you need to change in terms of your basic assumptions, your approach to the work and your habitual responses to the problems that arise. Try something different, keep adapting until you find a way that works, then push forward with determination.