in your connection information to your database, is the server localhost or another server name?
In most cases that I have seen where the server is localhost, you can connect remotely, in the other, ive found thru experieince that there is usually a firewall between the webserver and the database server which will only allow traffic thru from the webserver and not from external connections.
Having said that, one site I mange has an option to allow remote access which is user configurable, so Im not sure how that is managed, its just possible.