moko
asked on
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 ?
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.
It depends of your database engine. What are you using?
Have a look at http://www.able-consulting.com/MDAC/ADO/Connection/MSRemote.htm and http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForSQLServer
Have a look at http://www.able-consulting.com/MDAC/ADO/Connection/MSRemote.htm and http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForSQLServer
"Provider=sqloledb;Data Source=190.190.200.100,143 3;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
see http://www.connectionstrings.com/
see http://www.connectionstrings.com/
Fozy, are those credentials to the box or the DB?
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
if you want to connect access then you need to do it using VPN
if yoiu want to use access you can use it via msde this will treat access database as an sql server
cookre:
those are for the db (i.e. uid/pwd)
no need to logon to the box to access the sql server
those are for the db (i.e. uid/pwd)
no need to logon to the box to access the sql server
Const ConnStrWeb = "Server=172.21.9.39;Provid er=SQLOLED B;Database =cmsmaster ;UID=web_u ser;passwo rd=pwd007"
This is a connection string i use for SQL server
but it is intranet (not internet). Guess that should work for internet too.
This is a connection string i use for SQL server
but it is intranet (not internet). Guess that should work for internet too.
moko:
please maintain your questions
Questions Asked 7
Questions Open 5
Questions Graded: 2
Questions Deleted: 0
Last 10 Grades Given: B A
please maintain your questions
Questions Asked 7
Questions Open 5
Questions Graded: 2
Questions Deleted: 0
Last 10 Grades Given: B A
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.