Failed to connect to remote database server from service

I have implemetned a windows service and failed to connect to a remote database server when service running.

The server itself should not have any problem since we have been using it for the other non-service applications for a long time. And one more thing is that the connection succeeded when i try to connect to my local database from the exactly the same line.

Can anybody explain to me the possible reasons of this
Thanks in advance~


Answer this question

Failed to connect to remote database server from service

  • taia_gen

    Running the service in the context of local system It doesn't has access to the network.
    Use a  login for the service that has access to the network.

  • Asan

    Through ODBC If so, you need to use a system DSN.

    Ronald Laeremans
    Visual C++ team


  • Failed to connect to remote database server from service