I am soo glad you asked this question because I have been dying to pass on a "cure" that I came up with f several years ago. (Actually, I did mention this in another thread a year or so ago, but it is such a great tip, I don't mind doing it again.) Since I have started doing this, I have not lost a single squash -- of any variety -- to vine borers. Really, NONE!
All you need to do is go to your local feed/livestock supply store and purchase a couple of rolls of vet wrap. (This is identical to the stretchy bandages you can buy in any pharmacy for humans, but a LOT cheaper. And more colorful, usually.) When your squash has two or three true leaves on it, simply wrap a strip of vet wrap around the stem from just barely below the soil surface to the point where the stem narrows. As your squash grows, you may want to add a bit more to cover the thicker parts of the stem further up. The idea is that the rubberized bandage sticks tightly to itself (so no awkward tying or slipping as with cloth strips) but it stretches as the plant grows and does not squeeze it or stunt it. The bandage breathes and allows for moisture, but completely baffles the vine borer's instinct to drill into the vulnerable stems. Using a bright color, like pink or red also seems to confuse the borers -- who look for a green stem. (Don't use yellow as that color actually attracts many pests.) One roll goes a long way. The bonus is that vet wrap makes an ideal tie up for sprawling plants as well, so if you don't use it all as borer prevention, you can always use it to tie your tomatoes!
Of course, allowing squash to sprawl and root along the stems is another good way to keep them producing, since IF vine borers manage to breach the barrier or drill in above it, you will still have plenty of roots further along to salvage the plant when the main stem dies back. Same with cucumbers, pumpkins and melons.
If all else fails, and you notice a borer soon enough, you can sometimes save the plant by making a slit with a razor blade at the infestation site and pulling out the offending larvae. If you flush the "wound" with a dilute bleach or peroxide solution and tape it up, the plant will usually recover if not too badly damaged.
Planting white cushaw (actually most cushaws) is another good idea. They aren't necessarily resistant to the vine borer, but they will definitely give squash bugs a run for the money.