ASP ADO Use instance Tutorial

Source: Internet
Author: User

ASP using ADO

This lesson will provide a brief overview of what the use of ADO is, and why it is necessary to program the Repertoire in ASP. ADO technology supports ActiveX Data objects. An ActiveX Data object is a collection of parts that can be used in an ASP program.


Accessing the database
ADO technology is specifically used as a means of communication and manipulating databases. This type of database ADO technology allows you to interact with ASP programs including access, MySQL and databases, and so on. In this lesson, we will connect to an Access database, so you will need to get access (hop) to complete this lesson.

To create your Access database
Before you can connect to an Access database, you must first create an Access database file. Fire your copy of Ms Access and build the following repositories:

Create a new, blank database called "Tizag.mdb" (without quotes) and save it to the "C:inetpub wwwroot tizagasp" (without quotes)
Use the wizard to create the database.
New Two-field table: First and last Name
Click Next
Name table "Tizagtable" (not including quotes)
Select "Yes, create a primary key for me"
Click Next
Click Finish
Now that we have our database are still connected to it.

Connect to an Access database by using ADO
Create an ASP file named "Tizagado.asp" and save it in the same directory as your Access database file.

In the following ASP code, we first set up an ADO database connection, and then we set up the ConnectionString, and finally we call the Open method with our Access database file to complete the open process.

Come on, let's see the simple.

<%
Dim myconn
Set myconn = Server.CreateObject ("ADODB. Connection ")
MyConn.Open = (" Driver={microsoft Access "&_
" DRIVER (*.mdb)};D bq= "&_ "C:inetpubwwwroottizagasptizag.mdb")
Myconn.close ()
Set myconn = Nothing
%>

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.