ASP Knowledge Collation Notes 3 (question and answer mode) _javascript tips

Source: Internet
Author: User

Following the two "ASP knowledge Collation Notes 1" and "ASP Knowledge Collation Notes 2", "ASP Knowledge Collation 3" Freshly baked:

17. Question: What is the difference between using the AddNew method of ADO in ASP and using "Insert into ..." statement directly? Which Way is better?
A: The AddNew method of ADO only encapsulates "Insert into" statement, so when manipulating large amounts of data, using SQL statements directly will greatly speed up access to data because it reduces the "translation" Time of ADO. Because the operations performed by SQL statements are performed directly on the database server, they have a significant advantage, especially when the data volume is large.
18. Question: Why am I using standard Insert record statements in ASP to insert into books (Name,email) VALUES ("Kitty","Kitty@263.com") will make a mistake?
A: SQL (structured Query language/Structured Query language) is a data query language developed by IBM in the 1970 's and is now the standard for relational database query languages. An SQL statement is an English based program language that you can use to add, manage, and Access databases.
Strings that are added in an SQL statement can use double quotes, but in an ASP you need to use single quotes for normal execution. It should be written as insert into books (Name,email) VALUES (' Kitty ', ' kitty@263.com ').
19. Question: What is an ActiveX control? Where can I get these ActiveX controls?
A: Microsoft ActiveX controls are reusable software components developed by software vendors. In addition to the ASP's embedded objects, additional installed ActiveX controls can be used in ASP, which can save a lot of valuable development time, in fact, in the ASP also embedded a lot of ActiveX controls can be used.
With ActiveX controls, you can quickly add special features to Web applications and development tools. For example, use the AdRotator object to make the advertisement scroll board, use the FileSystemObject object for file access, and use the marquee object to implement scrolling text.
There are now more than 1000 commercially available ActiveX controls that can be developed using a variety of programming languages such as c,c++, as well as Microsoft Visual Java Development Environment, Microsoft visible J + +. Once the ActiveX control has been developed, the design and developers can use it as a preinstalled component for developing client programs. Using ActiveX controls in this way eliminates the need for consumers to know how these components are developed and, in many cases, do not even have to program themselves to complete the design of a Web page or application.
There are more than 1000 commercial controls currently provided by third party software developers. The Microsoft ActiveX component Library (ActiveX Component Gallery) has information and associated connections that point to a variety of 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 Use strstartport= (Request.Form ("catmenu_0") statement to take the value of the starting site in the form is not found in the database?
A: This is because the value of the starting site you are taking may have spaces, for example, the original intention is "Hangzhou", but because the space exists, the ASP program to take the value may be "Hangzhou", and the database only "Hangzhou" record, of course, can not find, the solution is to use the TRIM function will be the two spaces of the string to remove all, The corresponding statement is:
Strstartport=trim (Request.Form ("Catmenu_0"))
21, the problem: in the ASP when the life cycle of the variable, there are several ways to retain variable content?
A: Any action that causes the end of a Web page, such as pressing the "Refresh" button on the browser, or closing the browser, and then reopening it, will result in the end of the variable life cycle.
If you want to keep the contents of a variable at the end of a Web page for the next execution, you can use the Application object to implement it. For example, you can use the Application object to make statistics web site traffic counters.
The session object, like the Application object, stores the contents of the variable at the end of the Web page, but unlike the Application object, each online is a separate sessions object. Simply put, all online Internet users share only one application object, but each online surfer has its own session object.
The Application object and the session object can help us record the information on the server side, while the cookie object will record the information on the client with the help of the cookies provided by the browser. It is important to note that cookies are recorded in the browser information, so the data access is not as easy as accessing other ASP objects (information stored on the server side) so simple, in practice, only when the browser started browsing a server's Web page, The browser is able to exchange cookies data with the server before the server has downloaded any data to the browser.
22. Question: What should be done after the object is used?
A: When you finish using the object, you first use the Close method to release the system resources occupied by the object, and then set the object value of "Nothing" to free up the memory occupied by the object, otherwise the Web Service site will run inefficient or even crash because of too many objects, as follows:

<%
object. Close
Set object = Nothing
% >

The above is fresh out of the "ASP Knowledge to organize notes 3", welcome to READ 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.