Q: Why is my recordset's recordcount value always returns -1?
A: You should use this model to open the recordset of the access database:
RS.Open Strsql, CONN, 1, 1
The strsql is a SQL statement that operates a database; CONN is the connection variable of the join database.
Q: I wrote a lot of comments in the ASP script, which will not affect the speed of the server to process the ASP file.
degree?
A: The overall performance of the ASP file with too much annotation will only fall by 0.1%, which is basically not affected by the performance of the server.
Q: I need to use <% @ language = VBScript% in each ASP file?
A: If the scripting language you use is vbscript, please try not to use this statement, otherwise the overall performance will fall nearly 1.2%, but if you are not using the VBScript language, use this statement.
Q: Is there any "Option Explicit" in every ASP file?
A: You'd better, because this can make your program error chance to minimize, and will increase the overall performance of nearly 9.8%.
Q: What new features have you been with the ASP3.0 that appear together with IIS5.0?
A: In fact, there is no new change, but the new way to add two Server objects:
Server.Transfer and Server.excute, there is a new object asperror. Please refer to Microsoft's website: www.microsoft.com
Q: Why do I have an error when I use Response.Redirect?
A: The most common reason is that you modified the HTTP title after writing to the page, the method solved is to write <% response.buffer = true% in the start of the page.
Q: It seems that the redirect method can only be reached in the same frame, can it be oriented to other frames?
A: Yes, add this:
. Then, when you use
When the Redirect method is, it will reordbound to the name of the name called FrameName.
Q: Why do I often appear in the ASP page of the new window opened by "WINDOW.OPEN ()" method
SESSION lost phenomenon?
A: This happens often in Microsoft IE4.x, but this error has been solved in IE5.x. So, in order to be compatible with all browsers, you can use the parameters between the window, such as "Test.asp? Name = XXX", this effect is better, just pay attention, if the passing parameters are important, please Do not use a clear text to communicate, otherwise it is easy to lead to security issues.
Q: I often see two ways of DSN and DSN-Less, what do you mean? What is different?
A: DSN is the abbreviation of "Data Source Name", the DSN mode is also a connection mode of the data source, which can be set in "ODBC Data Sources" inside "Control Panel", then use this:
Conn.open "DSN = TEST; UID = admin; pwd =;"
The "Test" is the name of the data source you set. Note that you should use the UID and the PWD at the same time, otherwise it will be wrong.
Similarly, DSN-LESS is the connection method of non-data source mode, using methods:
Conn.open "Driver = {Microsoft Access Driver
(* .mdb)}; dbq = / somepath / mydb.mdb; uid = admin; pwd =; "
In the same hardware environment, the DSN-Less method is higher than the performance of the DSN mode, but once the ASP source code is subject to some security problems, it will leak the account account and password, so these two ways It is an advantageous.
Q: Use the ADDNEW method using ADO in ASP and use "INSERT INTO ..." statement and different?
That way?
A: ADO's AddNew method only encapsulates the "Insert INTO" statement, so when you operate a lot of data, use the SQL statement directly to accelerate the speed of access data, because he decreases ADO's translation "time. Although the SQL statement is not as easy to accept as ADDNew, etc., it is very important to learn some common SQL statements in the database programming.
Q: Why do I insert this sentence ("Let ''s Go Now!") Inserted into the database?
A: Because most databases (Access, MS SQL Server) uses single quotes as split symbols, it is not possible to directly insert single quarantin into the database, you must separate each single before executing the SQL statement The quotation number is replaced with two single quotes:
MyData = Replace (MyData, "''", "'' '", 1) Then, it will be done in the saved to the database.