Question

  Asked: Feb 27 2008   12:08 AM GMT
  Asked by: Blink.j


Connect to Microsoft Access database


VB6, Web development, Microsoft Access

I want to connect to an access database that is placed on an internet server. i use the following syntex when i want to connect localy.

With DB

.Provider= "Microsoft.Jet.OLEDB.4.0"

.Properties("Data Source").Value= "C:\Data.mdb"

.Open

.CursorLocation = adUseServer

End With


Can't i just change the datasource property that points to the database on the internet, and what information must i have from the sever to connect to it.

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



This code snippet is for a Access Database on the local machine. The methods properties for provider and data source would be different for a server based database. As it stands, this code will not work with anything other than an access database on the local system-- which might be good enough since the JET engine can be used regardless of whether access is installed on the system or not. (Though I don't know that you can use any version of access to create the database, since I normally connect to a SQL DB with my little pieces of code.)

As for the information you need, you'll need to know:

The Database software type and version (MS SQL 2000/2005/2008, MYSQL4/5, etc)
The Server Name or Full DNS name
The Port used by the SQL Server
The database name and table names
The username and password that is able to connect to the server
Finally, if the server is even available to you to connect. (I.E. if you are attempting to connect across the internet, it might be firewalled off from you)
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Development and Database.

Looking for relevant Development Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register