Recommended: The system time obtained by ASP has morning and afternoon solutions The solution to calling Now() in the ASP program always displays the morning and afternoon: 1. This display is usually because the server is set like this. First check the time format: double-click the time in the taskbar, and the words "am" in the pop-up time and date are indeed displayed. Then go to the next step of setting; 2. Open the control panel, select the area and language options, and in the area options
NextRecordset and GetRows are two properties of RecordSet that are very effective in improving batch query speed. You may use very little. Let’s share the usage of these two methods:
GetRows method: Extract the RecordSet record set into a two-dimensional array, and our behavior on the RecordSet data will be transferred to the array, and the record set can be disconnected early without using source data operations. rs.movnext, while not rs.eof, etc. can be saved.
NextRecordset method: When multiple queries are submitted at once to form multiple RecordSet result sets, a method that leaves the current work and transfers to the next RecordSet. It is mainly used in the case of result sets formed by multiple selects. Examples are as follows:
Query records
set rs=conn.execute(select Ca1, Ca2, Ca3, Ca4 from TableA select Cb1, Cb2, Cb3, Cb4, Cb5 from TableB)
'After execution, two select result sets will be generated, and the RecordSet of the first select is currently active.
arrA=rs.GetRows 'Get the 2D array that gets the first query result
set rs=rs.NextRecordset' Activate the next RecordSet
arrB=rs.GetRows 'Two-dimensional array that gets the second query result
set rs=nothing'Release the database object
In this way, all our data extraction about the database is completed and the database resources are released at the earliest time.
Note that the array obtained by the GetRows method has the first dimension representing the column and the second dimension representing the row.
Fori=0toUBound(arrA, 2)
response.write(<tr>)
response.write(<td>field 1: &arrA(i, 0)&</td>)
response.write(<td>field 2: &arrA(i, 1)&</td>)
response.write(<td>field 3: &arrA(i, 2)&</td>)
response.write(<td>field 4: &arrA(i, 3)&</td>)
response.write(</tr>)
Next
response.write(</table>)
'The second select table loop
response.write (<p>Table 2:</p><table>)
Fori=0toUBound(arrB, 2)
response.write(<tr>)
response.write(<td>field 1: &arrB(i, 0)&</td>)
response.write(<td>field 2: &arrB(i, 1)&</td>)
response.write(<td>field 3: &arrB(i, 2)&</td>)
response.write(<td>field 4: &arrB(i, 3)&</td>)
response.write(<td>field 5: &arrB(i, 4)&</td>)
response.write(</tr>)
Next
response.write(</table>)
advantage:
1. Using NextRecordSet, you can process the result set formed by sending multiple select statements at once, reducing network traffic and definitely speeding up!
2. Use GetRows to extract the record set into an array (memory operation, so the record set cannot be too large) to work with an array of memory, and save eof, MoveNext and other judgments, which is faster!
3. The most important thing is that we use both to complete all the data at once, quickly disconnect the database connection and destroy the established RecordSet database objects, greatly reducing network traffic! The performance will naturally be much improved!
Share: How to display server time in web page (asp) Display time on the web page. If the time on the user's native machine is taken, the time of the user is often inaccurate, so there is a problem with the display. The server time generally does not have too much error, so it is best to display the server time asp+js as an example. The following analyzes the code structure, first obtaining the server time: %d=Date() t=Time() % var t0=new Date().getTim