VB & Connection to access database

Posted on 2003-03-03
Medium Priority
Last Modified: 2010-05-01
by using the visual basic 6 and ADO , can i connect to access database file located in a site on the internet , if this possible , how can i do this

PS: i can make this conncetion using the ASP.Net , i tried to use the same method inside the VB but it doesnot work

Question by:ashraf_t
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Expert Comment

ID: 8061253
First off, you need to create a system DSN entry in Windows that points to the database at it's correct location.

What you then need to do is use an ODBC connection to connect to the database.

An example connection might be:


dim ODBCCon As ADODB.Connection
dim strCon as String

Set ODBCCon = New ADODB.Connection

strCon = "DSN=Internet_Access_DB; uid=admin; password=some_password; database=internet.mdb"

ODBCCon.Open strCon, "admin", "some_password"


There you go.  This assumes that you have created an ODBC (System DSN) entry called Internet_Access_DB that points to the database internet.mdb.

Hope it helps.

Author Comment

ID: 8066699
that is the problem , how to create this DSN file ?

Accepted Solution

OzWolf earned 120 total points
ID: 8067050
Ok, go to the Control Panel -> Administrative Tools -> Data Sources.

Then click on the System DSN tab at the top.  Click the ADD button.  Select the Microsoft Access Driver option.

Okay, now comes the difficult bit.  You need to actually map the internet folder to your computer.  To do this, click on the SELECT button in the ODBC Microsoft Access Setup window.

From here, click the NETWORK button in the bottom right hand corner.  At the bottom of the new window should be a link saying: Create a shortcut to a Web folder or FTP site.

Click on this link and the Add Network Place Wizard will appear.  If you know the web URL of where the database lives, just type it in (ie. http://www.my-site.com).  It should connect.  You might have problems with something like Geocities, but I have successfully connected to a database on other servers this way.




Author Comment

ID: 8114948
can u pls tell me one of the sites you had tested it , i prefer it free just for test ,
i tried to do what you said with my site but always get an error message the folder is invalid

Expert Comment

ID: 8115011
I actually did it on a private site (based in another city) and it worked.  Some free sites actually block outside access via this method (and FTP) due to the possible bandwidth abuse that can occur.  However, look for free website hosts that allow FTP access and you should be able to use the above method to access the database.

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question