WASHINGTON - The drive to end the ban on gays serving openly in the military survived another House vote Friday and now moves to the Senate, where advocates on both sides of the "don't ask, don't tell" debate are gearing up for a fight.

In a 229-186 vote, with 17 not voting, the House passed a defense bill approving $700 billion for military programs and containing an amendment repealing the 1993 law that allows gays to serve in the military only if they hide their sexual orientation.

All area representatives voted in favor of the bill except Jim Gerlach (R., Pa.), Frank A. LoBiondo (R., N.J.), Joseph R. Pitts (R., Pa.), and Christopher H. Smith (R., N.J.), who all voted against it.

Reps. Michael N. Castle (R., Del.) and Charles W. Dent (R., Pa.), who voted for the defense bill, had the day before voted against the repeal amendment, which was approved, 234-194, Thursday.

Earlier Friday, Defense Secretary Robert M. Gates appealed to the military not to be distracted by the political debate over gays in uniform. In an unusual direct address to troops, Gates assured them their views on the divisive question still mattered.

Gates supports repeal but had wanted Congress not to legislate before the military surveys how the change would affect operations.

Veto threat

He was overruled by the administration, which was pressed by gay-rights groups to take up the issue this year, when Democrats still hold a majority in Congress.

The Senate is to take up the defense bill this summer.

Its enactment is no sure thing. The White House on Thursday issued a veto threat because the House version includes $485 million for an alternative engine for the new F-35 Joint Strike Fighter.

Gates has sought to eliminate the second-engine program, saying it is wasteful. Supporters, besides seeking to protect jobs in their districts, say the competition will save money over the life of the $100 billion project.

President Obama will face a predicament if the final bill includes the second engine. If, as threatened, he vetoes the legislation, he would also be killing repeal of the "don't ask, don't tell" amendment.

House approval of the repeal was a major victory for Obama, who has pledged to change the policy, and for gay-rights groups.

'So much in here'

Sen. Carl Levin (D., Mich.), chairman of the Senate Armed Services Committee and a backer of repeal, said he hoped to get the defense bill to the floor before Congress leaves for a summer recess at the end of July.

"I believe a majority of the Senate, just like a majority of the country, . . . favor changing this policy," he told reporters Friday. "It is a discriminatory policy."

He predicted it would be hard for opponents to filibuster the defense bill over the gay-rights issue because "there's so much in here for our troops."

That includes money for security projects in Afghanistan and Pakistan; antiterrorism programs; billions for new ships, planes, and mine-resistant ambush protected vehicles; and money for ballistic-missile defense. The House bill has a 1.9 percent pay raise for military personnel; the Senate bill 1.4 percent.

The House and Senate amendments stipulate that the repeal would not become law until after the Pentagon study is completed and until the president, the defense secretary, and the Joint Chiefs of Staff certify that it will not have negative effects on the military's fighting ability.