August 27, 1999

Using URLEncode to Pass Query String Values

Question: I’m passing a string from one ASP template to another. The string may contain spaces so I call URLEncode, which works well as far as preventing the 400 Error for a malformed page. However, when I encode the Query String, it seems to muck up the code that gets

Access Legacy Data on Mainframe

Question: How do you access data on a mainframe using ASP? Answer: It depends on your mainframe application. If there is a way to connect to the data via ODBC or OLEDB then you can connect to it via ASP. If not, you may have to use a custom COM

Format a Date as mm/dd/yyyy

Question: I need a VBScript function that will format a date as mm/dd/yyyy. The FormatDateTime function does not give me this option and the CDate function wants to convert everything into mm/dd/yy. How can I do this? Answer: You can do this one of two ways. First, you can set

Prevent Viewing of Pages After Logout From Session

Question: For my company’s intranet, I used sessions to keep track of the user. When a user clicks on the logout button, the session is abandoned. However, even though the session gets terminated, you can still go to the previous page using the back button of the browser. How can

Programmatically Force a Save As Dialog Box

Question: Is it possible to force the file download box to appear through ASP? I want to create a file on the fly with the response.write method to fill its contents. The file should downloaded on the user’s machine through the dialog box with a user-defined filename as the default.

Read Content From a Remote URL

Question: How can I read the content of an HTML page from another URL? I tried using the FileSystemObject by providing the virtual path, but it says http permission is not accessible. Answer: It can’t be done using the FileSystemObject. Instead, write your own COM object using Visual Basic or

Read Metadata With OpenSchema

Question: How do I read the names of tables and fields in an Access database? I tried OpenSchema, but I got the error, “The operation requested by the application is not supported by the provider.” Answer: Your problem is in the Connection String you are using. On your Web server,

Use SQL Server Date Function to Calculate the Number of Days in a Month

The SQL server date function provides an easy way to calculate the number of days in a month. To calculate the total number of days in each month in SQL server, you can use datediff as shown: Select datediff(dd,’Feb 1, 2000′,’Mar 1, 2000′) This will give a result of 29

Minimize Data Conversions in Apps to Save CPU Cycles

The application should try to bind columns to a program variable of the same data type as the column in the result set. If the application still needs to have the data converted, it is more efficient for the application to ask the ODBC driver to do the data conversion

No more posts to show