I don't think we can give a definitive answer, because Tolkien never did, but a pretty clear answer can be worked out.
First, it's clear that Rivendell had substantial powers of resistance -- doubtless due in large part from Elrond's Ring. It's impossible to imagine that over thousands of years the Orcs never discovered its location, so they knew of it, but didn't dare attack (or attacked and were repulsed.) So Rivendell may have been a homely house with restful scenery and good food, but it was also a formidable fortress. The nearby orcs -- even if they chose to follow Sauron's orders -- could not have taken Rivendell.
Second. Take the Ring with Orcs? "How very trusting you have become in your old age, Mr. Sauron." The only entities Sauron could trust to take the Ring were ones he utterly dominated. So the only local forces were untrustworthy and couldn't be used even if they had the power to take Rivendell.
Third, So he had to bring up forces from Mordor. But logistics. By the time Sauron knew the Ring was in Rivendell, the Fellowship had left or was about ready to leave. There simply was no time to move trustworthy resources that far. (See What's the big deal about the Nazgûl losing their horses? for some discussion on timing.)
(This is a bit of a weak spot, since while there was insufficient time in 'reality', how could Sauron have known that? If he expected the Ring to go to earth in Rivendell, then he should have started a mobilization to send forces that he dominated north to get it. But apparently he didn't.)
Fourth, as @Valorum noted, it's much harder to take a fortress than to defend it. Elrond knew that he lacked to power to attack -- and in fact, he knew that he lacked the power to defend Rivendell indefinitely against Sauron.
... have we here the strength to withstand the Enemy, the coming of Sauron at the last, when all else is overthrown?'
'I have not the strength,' said Elrond; 'neither have they [referring to the just-mentioned Cirdan, and the rulers of Lórien]'
Bottom line: There was no practical way for Sauron to take the Ring by forces before it left Rivendell, and Elrond did not have to force to take on Sauron.