Connecting to a remote database ....

In .NET (or for that matter any language or platform), if we have the IP address of a remote server, which is on the internet, can we connect to it, and access the RDBMS on it ?
mokoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cookreCommented:
I use GetDriveType() to step through drive letters looking for an available one, use WNetAddConnection2() to map a drive to the remote, then have at it with, among others, OleDbConnection.
Éric MoreauSenior .Net ConsultantCommented:
fozyletCommented:
"Provider=sqloledb;Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"

see http://www.connectionstrings.com/
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

cookreCommented:
Fozy, are those credentials to the box or the DB?
bhagyeshtCommented:
you can connect most databases which have a server ie SQL server, MySql, oracle those that dont have a server component cannot be connected directly ie access/foxpro/txt.
if you want to connect access then you need to do it using VPN
bhagyeshtCommented:
if yoiu want to use access you can use it via msde this will treat access database as an sql server
fozyletCommented:
cookre:

those are for the db (i.e. uid/pwd)
no need to logon to the box to access the sql server

fozyletCommented:
Const ConnStrWeb   = "Server=172.21.9.39;Provider=SQLOLEDB;Database=cmsmaster;UID=web_user;password=pwd007"

This is a connection string i use for SQL server
but it is intranet (not internet). Guess that should work for internet too.
fozyletCommented:
moko:

please maintain your questions

Questions Asked  7
Questions Open  5
Questions Graded:  2
Questions Deleted:  0
Last 10 Grades Given:  B A
bhagyeshtCommented:
moko: can we have some feedback?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.