Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips
Tip Bank > Database Development > Active Server Pages

Active Server Pages - Page 3

41-60 of 432     Previous     Next
Cache frequently used read-only data in Application variables
by Francesco Balena
Unlike Session variables, there is only one instance of each Application variable. This means that storing data in an Application variable - including memory-consuming data such as long strings or arrays - doesn't severily impact on system performance (unless you store strings with thousands ...
Tricks with Server.MapPath
by Francesco Balena
The Server.MapPath method can be used to retrieve several interesting properties about the running ASP application, for example: ' the current directory currDir = Server.MapPath(".") ' the parent directory parentDir = Server.MapPath("..") ' the application's root directory
Response.Buffer and Response.Flush
by Jay Pipes
In order to redirect a web page after you have written to it, you ...
Displaying Quotations from Text Files
by DevX Pro
How do I return only the first four lines (a quotation) of a txt-file to my asp-file?
Proper Casing of a Word
by DevX Pro
How do I pick out the first letter in a word and convert it to an uppercase?
Providing a Much Nicer 404 Error
by DevX Pro
A user on my site clicks to retrieve a URL outside of my site, but the link is dead and the user receives a 404 error. Do you know of any methods to let me know when this happens? Ideally, I would like to trigger an e-mail to myself using STMP.
Avoid querying the ServerVariables collection
by Francesco Balena
You can access a lot of useful information through the ServerVariables collection, but this has a price in terms of performance. More precisely, the first time you reference this collection in a page, IIS must collect all the data that is necessary to create the collection. All the subsequent ...
Buffering is on by default in IIS 5
by Francesco Balena
You can speed up ASP by adding the following statement at the beginning of an ASP page: Response.Buffer = True This statement must be executed before any HTML text is sent to the client. When buffering is on, ASP sends data to the client browser only when the page has been ...
Don't use implicit connections when opening a Recordset
by Francesco Balena
As most ADO developers know well, there are basically two distinct syntax for opening a Connection and then a Recordset: you can explicitly create and open a Connection object, and then pass it to the 2nd argument of the Recordset's Open method (or assign to the Recordset's ActiveConnection ...
Split large HTML tables in smaller ones
by Francesco Balena
In general, a browser can't render an HTML table before the closing &/TABLE> tag is received. This means that the end user might wait for several seconds before a table result is displayed. The easiest way to have results appear as soon as they are available is subdivide a large HTML table ...
The MapPath method slows down execution
by Francesco Balena
The Server.MapPath method slightly shows down the execution of your ASP scripts, because IIS has to access some internal variables. For this reason you should try to avoid it if possible. In other words, you should code absolute physical paths in your ASP code, instead of using virtual paths ...
Use Response.IsClientConnected after long queries
by Francesco Balena
When you perform a complex and time-consuming query in your ASP program, you should periodically test whether the client is still connected, using the IsClientConnected method of the Response object, as in : ' a lenghty query here ' ... ' check whether the client is connected before ...
Action Queries and ADO Objects
by DevX Pro
Which is better to use for inserting or updating a record: Recordset object or Command object?
SQL Web Authentication
by DevX Pro
Given that NTCR is only good in a network environment, how can I redirect a user back to a login page (or trap something) if I pass their username and password into a OLE DB connection string and use SQL authentication? When a user is not in the SQL user list the error is: Microsoft OLE DB Provider for SQL Server (0x80040E4D). Login failed for user 'weblogin'. Apart from installing additional software on the server is there a elegant way to handle this and take the user to a nicer place?
Using Radio Buttons in a Form
by DevX Pro
I read an article about how to search a database upon the criteria provided by users. In the example, you showed how to use a drop down menu (combo box) and a text input box. If I have radio buttons, how can I place them?
How to Convert ADO RecordSet into the HTML Table
by Jitendra Kumar
The following code converts an ADO recordset into an HTML table by using the GetString function of the recordset. This method does not involve the looping or MoveNext method; it directly converts the ...
Export HTML Table to Excel
by Jitendra Kumar
Here is a simple way to export an HTML table to Excel with a single line of code. For the technique to work, you must have Excel installed on the your machine.
Default Script Error Handling on Your Web Pages
by Ajith Prasad
The unhandled or unexpected script error is a real issue these days. Script errors can be seen even on many of the professionally designed Web sites and Web-based customer applications. Sometimes the ...
Don't Buffer Your ASPs
by Manoj Mittal
Using the Buffer ...
ASP Number Formatting
by DevX Pro
How do I format my numbers in the format ######, where a number of 123 would display as 000123?
41-60 of 432     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date