It depends on your nationality, profession written on your id card, residency period, and such like. It's always much safer to get a visa from Qatar if you are not sure that you are eligible for a visa on arrival.

Travelling by car anywhere will require passage through Saudi, and it's a hassle to say the least. You will definitely need to apply for a transit visa beforehand, make sure all the ladies are completely covered while in Saudi, and the roads there are NOT SAFE AT ALL.