September 29, 1999

Prompt for Password in a Separate Dialog

Question: I want to display the “Enter Network Password” box when a user accesses my site. I can display an ActiveX control on my HTML page (ObjectID Tag) but it appears embedded. I want it to appear on top of my HTML page. Is it a property of Browser? Answer:

Strip Leading Zeros in ASP Output

Question: How do I strip off leading zeros from data displayed from an ASP page? Answer: Use the FormatNumber function.If value = “0000046” Then FormatNumber(value,0) will result in 46. FormatNumber(value,2) will result in 46.00

Retrieve Table Names From an Access Database

Question: How do I retrieve all the table names from an Access database using ASP? Answer: Make sure you have an ODBC DSN to point to your database. Then use this code to output all the tables in the database: ‘ — Declare variablesDim objConn, objRS’ — Declare constantsConst adSchemaTables

Access Client’s Windows Date Format

Question: I have a date field on my ASP page. I want to restrict the user for entering only the dates in his Windows 95 machine’s date format. How can I validate the date when I am using VBScript in my ASP page for client-side processing? Answer: If you are

Bypass the ‘RePost’ Message

Question: When I create an ASP page that gets sent to the browser, if users press the refresh button they get a message asking to repost from old data. How can I have the refresh recreate the page with the same information that was used to create it the first

Display a ‘Loading…’ Message in ASP

Question: How can I show a ‘Loading…’ message till my ASP page loads? Answer: Use the following code to create a “pgLoading.asp” page. Pass to it as a parameter the name of the page that is actually going to do the processing. So if pageA needs to call pageB where

Display Currency Fields in ASP

Question: I am querying an Oracle field that comes back in the format of 25.5. Because this is a currency field, I’d like to manipulate it so that it shows $25.50 before I publish it out to the Web. How can I do this? Answer: Use the FormatCurrency function in

Session Abandon Does Not Stop Back Button

Question: I have a session variable that keeps track of a user name and is set through a login page. Every page in the application first checks for the session variable and redirects to the login page if empty. I have a log out button that calls session.abandon and redirects

Create a Directory From an ASP Page

Question: How do I create a directory in ASP? Answer: Use the ‘CreateFolder’ method of the FileSystemObject object. Set fs = Server.CreateObject(“Scripting.FileSystemObject”)fs.CreateFolder (“foldername”) Obviously, you need to have proper permissions to be able to create a directory on the machine.

No more posts to show