Technology Characteristics and Usage of ASP
A few years ago, the industry's only channel in the dynamic home page is the CGI (Common Ga Teway Interface) mode. The technical solutions such as ISAPI, NSAPI, and JDBC are later made than CGI, but it is not suitable for rapid development, timely maintenance and large-area technologies from the technology reality of enterprises. The emergence of ASP technology, making the dynamic interactive web home page to become a relaxed and pleasant job. As long as a few rows of scripting statements, the background database information can be published on the Internet / Intranet, which is greatly superior to the traditional technical solution in the readability of programming and web scripts. ASP is an abbreviation for Active Server Pages, which is a server-side script environment, interpreted scripts on a web server, producing and performs dynamic, interactive, high-efficiency site server applications. ASP can be eligible for various dynamic data releases based on Microsoft web servers. ASP methods are the first to address the information system in the framework of the Internet / Intranet, the ASP method is the first to address the problem to access the background database information through the web page. All applications are split into a page form that the user's interaction is implemented in a submission form, which requires a strong dynamic data publishing capability. However, the current Web service is still dominated by providing "static" home page. The so-called "static" refers to the main page content of the site is "fixed", and it cannot be made according to the user's needs and actual conditions. When the browser applies for a homepage to the site's web server via the Internet's HTTP protocol, the site server will transfer the designed static HTML file to the browser. To update the contents of the home page, you can only update the HTML file data with non-line manual mode. The ASP is designed with the dynamic home page, which can receive the information submitted by the user and respond, where data can be changed without manually updating the web file to meet the application needs. For example, when filling a form on a browser and submitting an HTTP request, you can request a form set by a form on the site server, not just a simple HTML file. The application analyzes the input data of the form, and transmits the corresponding execution result (usually the result set of database values) to the browser in HTML format according to different data content. The database's data can be changed at any time, and the application executed on the server does not have to change, and the web information obtained by the client will always maintain fresh charm. The working principle and configuration of the ASP is as shown in the figure, when the user applies for a * .asp home page, the web server responds to the HTTP request, call the ASP engine, interpret the application file. When there is any script (such as VBScript and JScript) with ActiveX Scripting, the ASP engine calls the corresponding scripting engine. If the script instruction contains a request to access the database, the database access component is performed by the database access component through the ODBC. The ASP script is performed on the server-side interpretation, which automatically generates the home page that meets the HTML language based on the result set of the petition to respond to the user's request. All relevant published work is responsible by the web server. Figure 1 Active Server Pages work schematic must pay attention to the specific operation details of the visit. When there is a visiting script command, ASP is dialogue through ActiveX Components ADO (ActiveX Data Objects) (ADO is built in Microsoft New Database API, that is, OLE DB, the current OLE DB through ODBC Engine and existing The ODBC database interacts, further OLE DB version will be dedupted directly with the database, no longer passing the ODBC engine), and dynamically generate an HTML page to return to the server side to respond to the browser's request. In the user-end browser, the screen of the pure HTM L, such as the field content in the background database table in the table. Since the ASP combines the scripting language, you can access the ACTI VEX component, and have the ability to automatically generate HTML on site, so it becomes a valid tool for establishing a dynamic Web site. In terms of structure, the ASP is derived by ODBC with the database. Therefore, the upper layer can be compatible with various database systems. For the lower layer, the HTML generated by the ASP has extensive adaptability to the client's browser.
But ASP is picky to the web server itself, which seems to be a deficiencies, and it is actually a business strategy - it only supports web servers under Microsoft's various operating systems, and their lowest version is: · Windows NT Server 4.0: Microsoft INFORMATIO N Server 3.0; • Windows NT Workstation 4.0: Microsoft Peer Web Services 3.0; • Windows 95: Microsoft PWS (Personal Web Server) 1.0, Chinese Win95 should match Chinese PWS. The installation of ASP is divided into two cases of Windows NT and Windows 95. Both NT, IIS, and ActiveX Server Pages are included in Service Pack 3; for Win95, you can use the ActiveX Server Pages installation options in the Visual Studio server component. After the installation is successful, you will find an ActiveX SE RVER PAGES RoadMap home page in the program manager to guide you to learn and use the ASP. The Features of ASP and features are from the software's technical level. ASP has the following features: 1. Easy to generate without compiling the ASP script, which is easy to generate, without compilation or link, you can directly explain it. 2. Easy to generate the design of the * .asp page for easy generation using a regular text editor (such as a notepad under Windows). If you consider work efficiency, you may wish to use Visual InterDev with visual editing capabilities. 3. Separately use the browser that can explain the general HTML code to browse the homepage designed by the browser that explains the general HTML code. The ASP script is performed at the site server side, and the user's browser does not need to support it. Therefore, if you do not observe the * .asp home page from the server download, you will not see the correct page content in the browser. 4. Object-oriented can easily reference system components and ASP built-in components in the ASP script, and can also expand the functionality by customizing the ActiveX Server Component (ActiveX Server Components). 5. Compatibility with any ActiveX Scripting language In addition to the use of VBScript and JScript language, other scripting languages provided by third parties can be used by PLUG-IN. 6. The source code does not leak an ASP script executed on the server, and the user browser is only generated by the regular HTML code generated by the ASP execution result, which ensures that the procedure code written by the hard work will not be stolen by others. . From the application level, the ASP has the following features: 1. Draw the form input by the browser to the site server. 2. Access and edit the database tables of the server. Use the browser to enter, update, and delete data in the database of the site server. 3. Read the file of the site server to realize the functions such as visitors, motto. 4. Provide advertising wheel, obtain built-in functionality such as browser information, URL table management. 5. Read the hard disk file of the user end by cookies to record the user's data. 6. You can share information between multiple homepages to develop complex business sites applications. 7. Use the easy scripting languages such as VBScript or JScript to combine the HTML code to quickly complete the application of the site. Execute scripting languages, generate or change scripting languages executed by the site server. 8. The ability to expand functionality can be made by using Visual Basic, Java, Visual C and other program languages to meet their own special needs. The technology implementation method of the ADO pet library is an optimized access database-specific object set, providing a complete site database access solution for ASP. It can act on the server side to provide homepage content with database information. By executing the SQL command, let the user enter, update, and delete the database information of the site server in the browser screen. ADO uses a built-in RecordSets object as the main interface of the data. ADO can use VBScript, JScrip T language to control access to the database, and output display of query results. ADO can connect a variety of databases that support ODBC, such as SQL Server, Oracle, Info RMIX, etc.
When using, you first need to establish a corresponding DSN (data source name) in the ODBC of the control panel. To select the system data source name, specify the drivers used, such as "SQL Server", enter the DSN name in the data source name, and select the server and database. The design essentials that use the ADO access to the database is a few typical statements that master the ASP script, they are: 1. Define database components. There are two definition methods: • Use "Server.createObject" to establish a connection object. Set conn = server.createObject ("AdoDb.Connection") • Establish a connection object using the