There could be many reason for this
1) You are using 64 bit version and there are no 64 bit drivers for oledb
2) the appropriate dlls might not have registered in the machine
3) As you said its working in web but not windows, your IIS might be running under 32 bit but your wiondows on 64 bit
check this thread which gives more info on the above said and other issues as well..