To prevent the vine borer from laying eggs, many people recommend using a floating row cover. The moth that infests the plants finds them by brushing up against the spines on the stalks of the plant, the theory is if they are covered, they won't be as easy to detect. I have never tried it, but lots of people seem to think it works.
Some say that a late planting of squash will avert infestation, this has never worked for me. I have gardened in San Antonio and Dallas and I cannot seem to pinpoint the lifecycle of the borer well enough to completely miss either generation. Perhaps there is not as much of a distinction between the spring and late summer generatios as there are in some other parts of the country...
There are two basic approaches to fixing a borer problem that I have found to be effective. The first is to inject a Bt "liquid worm killer" (the one I use is made by greenlight) with a large hypodermic needle. The vascular system of the plant will only carry it so far, however, so you have to kind of estimate how far the worm has penetrated, and try squirting it in both directions from the point of entry. Along the same lines, I have used Dipel dust (a Bt product also made by greenlight) and sprinkled it on the base of the plant every few days.
Procedure #2 is a little more involved, but I chose to use this method today on about fifteen of my summer squash plants. Using a box cutter or sharp knife, slit the base of the stem vertically (not against the "grain" of the vascular system, or it won't heal and will just kill the plant) and digging the little boogers out manually. Crude but effective. You should then bury the wounded part of the plant under a mound of moist earth to promote healing and root growth. It works more often than not...
Sorry this was so long but the struggle against the squash vine borer has been a multigenerational conflict of epic proportions in my family