Asp knowledge sorting notes 3 (Q & A mode) _ javascript tips-js tutorial

Source: Internet
Author: User
This is the second note on asp knowledge sorting. Only by figuring out the most basic problems can we better learn ASP programming. After the last two articles, asp knowledge preparation notes 1 and asp knowledge preparation Notes 2, asp knowledge preparation notes 3 is released:

17. Question: What is the difference between using the AddNew method of ADO in ASP and directly using the "Insert into..." statement? Which method is better?
A: The AddNew method of ADO only encapsulates the "Insert into" statement. Therefore, when operating a large amount of data, the direct use of SQL statements will greatly speed up data access, because it reduces the "Translation" time of ADO, because the operations executed by SQL statements are directly performed on the database server, especially when the data volume is large, it has significant advantages.
18. Question: Why do I use the standard insert record statement insert into books (name, email) values ("kitty ","Kitty@263.com") Will there be errors?
A: Structured Query Language (Structured Query Language) is a data Query Language developed by IBM in the 1970 s. It has become a standard for relational database Query Language. An SQL statement is an English-based programming language that can be used to add, manage, and access databases.
Although double quotation marks can be used for strings added to SQL statements, single quotation marks are required in ASP for normal execution. Therefore, insert into books (name, email) values ('Kitty ', 'Kitty @ 263.com') should be written ').
19. Question: What is ActiveX Control? Where can I obtain these ActiveX controls?
A: Microsoft ActiveX controls are reusable software components developed by software providers. In addition to ASP embedded objects, ActiveX controls installed can also be used in ASP, which can save a lot of valuable development time, in fact, many ActiveX controls are embedded in ASP.
Using ActiveX controls, you can quickly add special functions to Web applications and development tools. For example, you can use an AdRotator object to create an Ad scroll board, use a FileSystemObject object to access files, and use a Marquee object to implement scroll text.
Currently, there are more than 1000 commercial ActiveX controls. ActiveX controls can be developed in a variety of programming languages, such as C and C ++, and Microsoft Visual Java Development Environment Microsoft Visual J ++. Once the ActiveX control is developed, designers and developers can regard it as a pre-assembly component for developing customer programs. By using ActiveX controls in this way, users do not need to know how these components are developed. In many cases, they can design webpages or applications without programming themselves.
Currently, there are more than 1000 commercial controls provided by third-party software developers. The Microsoft ActiveX Component Library (ActiveX Component Gallery) stores related information and connections, which direct to various ActiveX controls provided by Microsoft and third-party developers. In the Microsoft ActiveX Component Library (ActiveX Component Gallery), you can find a list of companies that develop Internet-enhanced ActiveX controls.
20. Question: Why can't I find the value of the start site in the Form in the database using the strStartPort = (Request. Form ("catmenu_0") statement?
A: This is because the starting site value may contain spaces. For example, if the origin site is "Hangzhou", but because of the space, the value obtained by ASP may be "Hangzhou ", however, the database only contains records of "Hangzhou", which cannot be found. The solution is to use the Trim function to remove all spaces at both ends of the string. The corresponding statement is:
StrStartPort = TRIM (Request. Form ("catmenu_0 "))
21. Question: When the lifecycle of a variable ends in ASP, how many methods can be used to retain the variable content?
A: Any operation that causes the web page to end, for example, when you press the "refresh" button of the browser or close the browser and re-open it, the lifecycle of the variable will end.
If you want to retain the variable content at the end of the web page for the next execution, you can use the Application object. For example, you can use the Application object to create a counter for counting website visits.
The Session object is the same as the Application object. The variable content can be stored at the end of the Web page. However, unlike the Application object, each online Session object is an independent Session object, simply put, all online netusers only share one Application object, but each online netuser has its own Session object.
The Application Object and Session object can help us record the information on the server, while the cookie object will record the information on the client through the Cookies function provided by the browser. Note that Cookies are recorded in the browser. Therefore, data access is not as simple as accessing other ASP objects (storing information on the Server, the browser can exchange Cookies with the Server only when the browser starts to browse a webpage of the Server and the Server has not downloaded any data to the browser.
22. Question: What should I do after the object is used up?
A: After an object is used up, use the Close method to release the system resources occupied by the object, and set the object value to "nothing" to release the memory occupied by the object, otherwise, the website may run less efficiently or even crash due to too many objects. The corresponding statement is as follows:

<% Object. closeset object = nothing %>

The above is freshly bakedAsp knowledge sorting Note 3,You are welcome to read it carefully.

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.