For getting data from other server where your database is held you need to do this...
Get the connection string fro that server....
set the database connection using that string...
To connect to SQL Server running on a remote computer (via an IP address)
oConn.Open "Driver={SQL Server};" & _
"Server=xxx.xxx.xxx.xxx;" & _
"Address=xxx.xxx.xxx.xxx,1433;" & _
"Network=DBMSSOCN;" & _
"Database=myDatabaseName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword"