How Do I Bind a Database to a WebFX Combo Box Control?

Posted by: Imar Spaanjaars at Saturday, June 05, 2004 12:22:50 PM in: Classic ASP
An often requested feature in Web applications is a drop-down that behaves like a Combo Box in Windows applications. If you start typing in a drop-down in a Windows application, it will preselect an item that starts with all the letters you type in. The drop-down in a Web browser preselects the item that starts with the last letter you typed in. Not very convenient. Fortunately, there are many replacements for the default drop-down available. One of them is the WebFX Combobox. In this snippet, I will demonstrate you how to fill this control with information from a database. I won't be discussing how the control works, and I also won't explain how you can use the advanced features of the control that allows you to add new data. This snippet will simply demonstrate how to generate the client-side code for the drop-down with information from a database.
Read on ...

Find Out Whether a Specific Column Exists in a Database Table

Posted by: Imar Spaanjaars at Monday, March 15, 2004 3:33:05 PM in: Classic ASP
This snippet will allow you to check whether a certain column exists in a database table or not. Useful when you're coding against a database which schema you don't fully know. Just change the name of the column you're looking for (nameToCheck), the Connection String and the SQL SELECT statement, the bold items in this snippet.
Read on ...

Display Information About a Microsoft Access Database

Posted by: Imar Spaanjaars at Thursday, February 19, 2004 3:06:04 PM in: Classic ASP

The following block of code will display the properties of ALL tables in a Microsoft Access database. For the code to run successfully, the variable MyConnectionString needs to contain a valid connection string pointing to the Access database.
With this code, all tables, including system tables are displayed. If you want to limit the list, use myTable.Type to determine the type of the table and skip the system tables. User tables will return "TABLE", while system tables will return "ACCESS TABLE".

If you want to display information about just a single table, remove the For Each loop and uncomment the line that starts with Set myTable. Don't forget the pass the name of the right table to the Tables collection.

Read on ...

Execute a Stored Procedure Without an Explicit ADO Command Object

Posted by: Imar Spaanjaars at Thursday, February 19, 2004 11:42:30 AM in: Classic ASP
The following code shows you how to execute a Stored Procedure (called MyStoredProcedure) in ASP without creating an explicit ADO Command object. The Stored Procedure expects two parameters: @FirstParam (of datatype int) and @SecondParam (of datatype varchar). Modify the parameter list to suit your requirements
Read on ...

How Do I Check If a Number Is Even Or Odd in ASP?

Posted by: Imar Spaanjaars at Saturday, November 08, 2003 8:52:05 PM in: Classic ASP
Use this snippet to check whether a given number (passed in as numberToCheck is even or odd.
Read on ...

Preventing a Page from Being Cached by Browsers and Proxy Servers

Posted by: Imar Spaanjaars at Sunday, November 02, 2003 5:30:19 PM in: Classic ASP
Add the following code to the top of your ASP page to prevent it from being cached by the browser or any intermediate proxy or caching server. This will force the browser to retrieve a new copy of the page, everytime it needs to display it.
Read on ... 1