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