Rookie learning ADO Overview of the example tutorial

Source: Internet
Author: User
Tags iis connect odbc odbc connection window access database microsoft access database access
ado| Tutorial

Site original content, reproduced please indicate the source Web page teaching network .

ADO enables your Web page to display the contents of the database, in other words, our Dynamic Web program can pass the data in the ADO proxy database. This tutorial is mainly for ASP beginners This reference to learn a primer tutorial, through the example, let you learn Dynamic Web page call database method.

You should first learn about the basics of HTML, the ASP (Active Server Pages) Basics, and the basics of SQL (structured Query Language) in the context of this tutorial. You can check the relevant content from the relevant columns of this site.

What is ADO?

ADO is a Microsoft technology, is the abbreviation of ActiveX Data Objects, it is Microsoft's Active-X component, it installs automatically with the installation of IIS, it is used to access a program that records in the database.

ADO enables ASP pages to access data from the database. The general procedure for accessing data in a database in an ASP page is to create a connection to a database, open a database, create an ADO recordset, open a recordset, Access data from a recordset, close a Recordset, and close a connection to a database.

The connection to the ADO database. Before connecting, we will first create a database, and as for how to create a database, we are not covered here.

Create a dsn-less database connection

Connecting to a database in dsn-less connection is the easiest way to connect any Microsoft Access database on a Web page through a dsn-less connection. Suppose you have established a database named Webjx.mdb in your site directory and placed it in the e:/webjx/directory so we can use the following code to implement the ASP connection to the database:

<%

Set Conn=server.createobject ("ADODB. Connection ")

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

Conn. Open "E:/webjx/webjx.mdb"

%>

The code above should be executed correctly you must have Microsoft Access installed and your database is actually in the site directory.

To create an ODBC database connection:

If you already have an ODBC data source named WEBJX, then we can connect to the database by using the following ASP code:

<%

Set Conn=server.createobject ("ADODB. Connection ")

Conn. Open "WEBJX"

%>

With ODBC you can connect to any database on the computer on the Internet, provided that the ODBC connection is allowed!

To connect an MS Access database with ODBC:

Start → settings → control Panel → data Source (ODBC), and then in the window that appears, select System DSN (data source Name), click the Add button, select Microsoft Access driver click Finish. Click Select in the window that appears to select the local database, and then enter a data source name and click OK.

By using the above method, you are ready to connect your Web page to the database on your computer, and if your computer is running Personal Web Server (PWS) or Internet Information Server (IIS), the above settings will take effect. If your site is a remote site, then your site has been set up above the environment. After all, we learn to teach you how to connect to the database configuration method is necessary.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.