When faced with a somewhat similar problem I chose to access the db via XML using HTTP. See
this Microsoft article for more information. I had to get the IIS team to "turn on" this feature, but it was very simple, or so they said.
It was easy to use perl to parse and manipulate the XML results.