WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

ADO Database Connection


Before a database can be gotten to from a website page, a database association has to be established.


Create a DSN-less Database Connection

The least demanding approach to associate with a database is to utilize a DSN-less association. A DSN-less association can be utilized against any Microsoft Access database on your web site.

If you have a database called "northwind.mdb" situated in a web catalog like "c:/webdata/", you can associate with the database with the accompanying ASP code:

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
%>

Note, from the model over, that you need to determine the Microsoft Access database driver (Provider) and the physical way to the database on your computer.


Create an ODBC Database Connection

If you have an ODBC database called "northwind" you can associate with the database with the accompanying ASP code:

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "northwind"
%>

With an ODBC association, you can interface with any database, on any PC in your system, up to an ODBC association is available.


An ODBC Connection to a MS Access Database

Here is the means by which to make an association with a MS Access Database: 

  1. Open the ODBC symbol in your Control Panel.
  2. Choose the System DSN tab.
  3. Click on Add in the System DSN tab.
  4. Select the Microsoft Access Driver. Snap Finish.
  5. In the following screen, click Select to find the database.
  6. Give the database a Data Source Name (DSN).
  7. Click OK.

Note that this design must be done on the PC where your site is found. On the off chance that you are running Personal Web Server (PWS) or then again Internet Information Server (IIS) all alone PC, the guidelines above will work, yet in the event that your site is situated on a remote server, you need to have physical access to that server, or ask your web host to do this for you.