August 28, 2001

Disable HTML Elements

HTML elements can be made inactive and non-responsive by using the disable attribute. When HTML controls are disabled, they appear dimmed and don’t respond to user input. This is useful when you’re trying to prevent a user from entering information into controls that do not apply to them, potentially cutting

Run a DOS Command From an HTML Page

This is achieved by using the Windows Script Host. First, create an instance of the object WScript.Shell. Then, use its Run method to execute the DOS command. For example, say your HTML page has a button that will run the DIR command when clicked. The onclick jscript function would look

How To Ensure That the Page is not Cached

Setting Response.Expires to a negative number or 0 disables caching. Sometimes, the use of Response.Expires = -1 doesn’t work because of mismatches between the clocks on the server and the browsers. Be sure to use a large negative number, a little more than a day (1440), to work around those

Opening an Access DB

Before starting, add the Microsoft DAO 3.51 Object Library Reference. Private Sub Form_Load() Dim WkSp As Workspace Dim dB As Database ‘Define the file .MDW where are the users and passwords used to Access the database dbengine.SystemDB = “System.mdw” ‘Create a WorkSpace with the user’s information Set WkSp = dbengine.CreateWorkspace(“WkSpName”,

Use ‘With..End With’ in Your ASP Scripts

You can use the ‘With … End With’ statements if you are using VBScript 5.0 or later. It helps to improve performance. This runs slower: PersonObj.FirstName = “Sandeep”PersonObj.LastName = “Gain”PersonObj.City = “Rajnandgaon” This runs faster: With PersonObj .FirstName = “Sandeep” .LastName = “Gain” .City = “Rajnandgaon”End with

A Query That Identifies Users’ Inactivity Time in an Oracle Database

Oracle DBA’s can run this query to terminate sessions if users are inactive for more than certain time period for any Security/Performance reasons. select s.username “User”, s.osuser “OS User”, s.sid “Sid”, decode(s.type, ‘USER’, ‘User’, ‘BACKGROUND’, ‘Backgd’, s.type)”Type”, decode(s.status,’INACTIVE’,’Inact ‘ || round((s.last_call_et/60),0) || ‘ min’, ‘ACTIVE’, ‘Active’, s.status) “Status”, to_char(s.logon_time,’dd/mm hh24:mi’)

Get User Name, Domain Name, Temp, and System Folder Without an API

Use Environ var. This Works Only on Windows NT and 2000. Me.Label1 = “Temp Dir – ” & Environ$(“temp”) Me.Label2 = “Sys Dir – ” & Environ$(“windir”) &IIf(Len(Environ$(“OS”)), “SYSTEM32”, “SYSTEM”) Me.Label5 = “User Domain: ” & Environ$(“USERDOMAIN”) Me.Label6 = “User Name: ” & Environ$(“USERNAME”)

Fix MSVC++’s “for”

MSVC has a small, but annoying bug with the scope of variables defined in “for” loops. For example, the following fragment is valid C++, but will not compile on MSVC: for(int i=0; I

No more posts to show