Neither.
Both of those breeds are too prey-driven to be well suited to a household with a cat! :(
If the dog is raised from puppyood with cats around, that does improve the odds. *Sometimes,* dachshunds and terriers can learn to get along with a cat if raised with them from puppyhood.
However, sometimes they do not learn to get along, even if raised with the cats from puppyhood. It is a highly individual thing. I've seen way too many dachshunds and terriers get brought in to shelters, because despite being raised with cats from puppyhood, they "didn't learn to get along with the family cat." :(
There is no guarantee that the puppy would learn to get along with cats. And if s/he doesn't learn to get along with cats, then what?? It wouldn't be good to have to give the dog up!!
The bichon frisee, the miniature schnauzer, the shi tzu, the yorkshire terrier, and the mini poodle are the only cute, playful little dog breeds I know of that nearly always will get along OK with cats!
Some chihuahuas, some pugs, and some boston terriers are OK too, but it varies from dog to dog with those breeds.
Dachshunds were selectively bred to hunt & kill rabbits, ground squirrels and other small mammals. They will view a cat as a rabbitlike animal that they are supposed to hunt and kill! :(
Terriers were bred to get rid of small pest animals, and in general they will view a cat as a pest animal to get rid of. This includes Cairn Terriers. :(
For some reason, possibly the breeding for miniaturization, the Yorkshire Terrier tends to not have this trait any longer.
Also, this was my experience as a dog breeder. I tried breeding Cairn terriers and dachshunds at first, but they kept disturbing the peace with barking and upsetting my neighbors who own cats, by going nuts whenever a cat was near. This neighborhood's full of cats.
So then I did some research and switched to bichons and miniature schnauzers. No more problem!