ASP Design FAQ and answers (2)

Source: Internet
Author: User
9. Question: do I need to use "Option Explicit" in every ASP file "?
A: In practical applications, the VBScript variable concept has been vague, allowing direct use of variables without the need for Dim to declare variables. However, this is not a good habit and may cause program errors, because a variable may be defined repeatedly. We can use the Option Explicit statement in the program. When using a variable, we must declare it first. If no declared variable is used, an error occurs during running.
Practice has proved that using "Option Explicit" in ASP files can minimize program error opportunities and greatly improve overall performance.
10. Question: what are the security measures for running ASP files?
A: ASP provides a good code protection mechanism. All ASP code is executed on the server and only returned to the client for code execution. However, it still does not rule out the deliberate destruction of Web servers by malicious people. Therefore, you must pay attention to security issues when writing ASP files.
Although inc is introduced in ASP, it is recommended that ASP be used as the extension of the cited file. When these codes run on a Web Server with poor security mechanisms, you only need to enter the address of the introduced File (inc is the extension) in the address bar to view the content of the introduced file, this is because on the Web Server, if the dynamic connection library of a certain type (such as inc) is not defined, the file is displayed as source code.
In addition, do not place database files inside the website structure. In this way, when attackers obtain the database path, they can easily obtain the database and modify the database content. A good practice is to create a data Source Name DSN (Date Source Name) for the database, and store information about the connection to the specified data provider in DSN, including: "physical location of the database, the type of the driver used to access the database. Any other parameters required by the driver used to access the database. "You can directly access the DSN when accessing the database.
11. Question: which questions should I consider when reviewing the Web database management system?
A: When evaluating a Web database management system, three problems must be taken into account: Multi-User problems; the Web database established should be relational databases; and database security problems.
12. Question: What is ADO and how does it operate databases?
A: The full name of ADO is ActiveX Data Object (ActiveX Data Object). It is a special set of optimized database access objects. It provides ASP with a complete site database solution, it serves on the server and provides the homepage content containing database information. By executing SQL commands, users can enter, update, and delete information about the site database in the browser screen.
ADO mainly includes three objects: Connection, Recordset, and Command. Their main functions are as follows:
· Connection object: Opens or connects to database files;

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.