Use ASP to access various common type database (1)

Source: Internet
Author: User
Tags dbase odbc ole access database
Data | Database Summary:

This paper discusses the method and function realization of using ASP to access DBF, DBC, MDB, Excel, SQL Server data, and finally gives an example of accessing Excel database by using the function provided in this paper, which has strong practical meaning for enterprise data reuse and sharing.

Keywords:

ASP database access DBF DBC MDB Excel SQL Server

Objective

The Internet/intranet Web pages are filled with Internet feature modules such as message boards, discussion groups, online polls, online surveys, and chat rooms, which are implemented using ASP (Active Server Page) and database technology. Most of the databases used on Internet/intranet are MDB databases or sql< databases, but in enterprise intranet< networks, various versions of databases already exist such as dbf<, DBC, Excel, and text databases. These databases are generated by application software such as Office automation system, financial software and so on, if the ASP can directly use these types of databases, there is no need to re-establish the database, and further realize the enterprise data sharing, whether these databases can be directly used by ASP, the author after a long discussion summed up to give a positive answer


ASP Object Access database method

In ASP, the object used to access the database is called ADO (Active Data Objects), which contains three kinds of objects: Connection, Recordset, Command, where Connection is responsible for opening or connecting to the database. The recordset is responsible for accessing the data tables, command is responsible for executing the actions query (action queries) commands on the database and executing the stored Procedure of SQL Server. You must also have database-accessible drivers, OLE DB drivers, and ODBC drivers that rely on only these three objects or cannot access the database. For any database, you must have a corresponding OLE DB driver and ODBC driver,ado< to access the database. The access process can be described in the following figure:

  
As the above figure shows, ADO objects must be combined with a variety of drivers to access various types of databases, different databases require different drivers. What drivers are installed on the machine? You can verify which drivers are installed on our machine by verifying that the Drivers tab in the Windows9x or nt "start" → "settings" → "Control Panel" → "ODBC Data Source (32Bit)". There are approximately the drivers listed in the following table:

< driver < applicable database type
  
Microsoft.Jet.OLEDB.4.0 Mdb
  
Microsoft Access Driver Access
  
Microsoft dBase Driver DBase



Related Article

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.