Question Connecting to Remote Database and Folder(s)

Joined
Mar 4, 2009
Messages
1
Programming Experience
10+
Hi everyone,

I got a two prong question that is connected and it's been bugging me for some nights now so I appreciate the assistance...

I got a remote location (http://www.mysite.com) that I want to access via a desktop application (MyApp). It needs to connect to a database on that site to retrieve user information... How do I refer to that database?

And the second part is how do I refer to a folder in that website, such as http://MySite.com/folder1? Can I just go...
folder="http://www.mysite.com/folder1" ?

And I'm trying to make it so I don't need to know the exact IP Address? Please help :D.
 
You should visit ConnectionStrings.com - Forgot that connection string? Get it here! to find the appropriate connection string format(s) for your database. Connecting to a remote database is pretty much the same as connecting to a local database. You just nee to know the server address.

That said, while some databases support connections over HTTP it is very rarely enabled. Basically you're going to have to know the IP address of the database server to connect.

As for folders under a domain, they are just strings. You can treat them like any other strings, including folder and file paths in your local file system. You can store a folder path in a String variable and then append various file names to it to access files.

If this doesn't answer your question then please rephrase and specify more clearly exactly what you're trying to achieve.
 
Hi everyone,

I got a two prong question that is connected and it's been bugging me for some nights now so I appreciate the assistance...

I got a remote location (http://www.mysite.com) that I want to access via a desktop application (MyApp). It needs to connect to a database on that site to retrieve user information... How do I refer to that database?
As jmc points out, your normal database connection string is something like:

Provider=Oracle.Driver.1;Data Source=LOCALSERVER;User=whatever..

Just change it to:

Provider=Oracle.Driver.1;Data Source=www.mysite.com;User=whatever..

NOTE: you need the database on that server to be contactable. I.e. in the case of Oracle who listens on port 1521, the website would ahve to accept connections on port 1521 and route them to the db there. A discussion of how to do that is beyond the scope of this topic, you'll need to ask the dba at the remote site

And the second part is how do I refer to a folder in that website, such as http://MySite.com/folder1? Can I just go...
folder="http://www.mysite.com/folder1" ?

Windows File Sharing works over the internet:

\\www.mysite.com\sharename\blah

But again, you will likely find that the administrator of the server has switched off file sharing (cause it's a bit dumb idea if you dont have VERY strong passwords etc) so you have to speak to the server admin.

Probably it would be better if you can go via FTP, SFTP, HTTP PUT or some other method already working with the existing firewall. Discussion of such concepts is outside the scope of this topic too
 

Latest posts

Back
Top