search and icons



home all news Price and Order For Tornado ASP-db Forum call us










ASP-db Examples


Classic ASP server is no longer in service. Please click here to Download the entire set of example files (12 MB)

Classic ASP-db Examples

Following is a collection of simple ASP pages that were created with ASP-db. 
The source code for every example is included on that page

A. Formatting & Layout

Example A1 How do I format my numerical fields as currency ($1,234.50)? Other Formats?
Example A2 Can I show my numerical fields as bar charts? Show me!
Example A3 I have a True/False field. Can I show it as Yes/No or with icons for yes/no?
Example A4 How do I turn off column sorting, or hide the Header row?
Example A5 Can I control the Borders around a grid/form? How about the width?
Example A6 Can I change the Color, Width, and Alignment of the Column Headers?
Example A7 I don't want any headers, status bar or buttons, just the data. Can it be done?
Example A8 Can I bold certain fields or change their color, font or size?
Example A9 How do I rename fields or control their layout?
Example A10 The navigation bar... does it have to be at the bottom? I want it at the top.
Example A11 How do you control which buttons are visible? Can I replace them with my own?
Example A12 How can you avoid printing duplicate values and "Group" your rows together?
Example A13 Choosing your own "Drill-Down" field in dual mode
Example A14 Customized Field Placement Overview
Example A14a Customized Field Placement Sample Page
Example A15 Creating "mailing label" style reports (one "form" below another)

 

B. Browsing, Filtering & Selecting Particular Records

Example B1 Can I view All the Tables in a data source? (Also shows a SQL Server database)
Example B2 Creating a "Front-end" search screen using the ASP-db Filter
Example B2a Creating a "Front-end" search screen using an HTML FORM
Example B3 Can I make a "Select" box that shows all the records at once?
Example B4 A Frame with selection criteria on the left and data on the right
Example B5 I want to have some of my fields be "Drop-down" fields. How is that done?
Example B6 Checking a User ID & Password before showing the user's data

C. Displaying Embedded Images, Exporting Data and More

Example C1 How do I put an image (picture) in a table cell?
Example C2 How do I 'Click-to-enlarge' an image (picture) in a table cell?
Example C3 Can I have a cell be an "HREF" link to another file? How?
Exampile C4 How do I turn on the "Download" button and control which file it creates?
Example C5 How can I "Export" the record that the user clicks on and use it in another file?
Example C7 Can I replace the std. error message ASP-db shows when no records are found?
Example C8 How do I specify the User ID and Password for my data source?
Example C9 Can I use an Excel Spreadsheet as a data source for ASP-db?


 APPLICATION EXAMPLES (View and Pro feature set)

These examples are not detailed application examples, but rather are 'code snippets' that are designed to show various programming techniques with ASP-db™.

NOTE:   If you are looking for EDITING Examples, see Examples 101 127 below ...

Examples that work with ASP-db View™ and ASP-db Pro™:

( 1a) A Simple Example using the Northwind Database.
( 1b) Northwind Database showing a variety of fonts, colors, images, custom status bar, etc.
( 1c) Northwind Database allowing you to CHOOSE which fields you want to see.
( 1d) Northwind Database showing you a Custom Status Bar on a Form.
( 1e) Northwind Database using dressed-up text navigation buttons.
( 1f) Northwind Database showing the Status Bar at the top.
( 1g) Northwind Database showing a Memo Field in Grid and Form (also drop the Time from a Date/Time field)
( 1h) Northwind Database showing a Memo Field below a Grid.
( 1i) See 3 Memo Fields on a Form.
( 2 ) ASP-test.mdb Database using Tiny Text which shows how small you can get.
  You will also see a user-defined Filter Title.
( 3a) Example of dbMode="Both" where you click on the GRID to drill down into a FORM.
( 3b) Example of dbMode="Both" where the Form is a User-defined display.
( 3c) Example of dbMode="Both" and having all fields be "drill-down" fields, using MagicCell's IndexAnchor.
( 3d) Example of dbMode="Both" and suppressing the Nav buttons on the form.
( 4a) Example of Various Number Formatting (also shows StatusBar Color).
( 4b) Example of Various Date Formats.
( 4c) Example of More Date Formats.
( 4d) Example of Various Time Formats.
( 4e) Example of Various Time Formats (using SQL).
( 4f) Example of Specifying the Date Format in the SQL statement.

The next 7 examples show how to write your own query (filter) screen, and the correct use of dbReset.

( 5a) Example of Initial Query Form then show a GRID
( 5b) Example of Initial Query Form then show a FORM (also shows the O'Neil technique)
( 5c) Example of Initial Query Form then pass parameter on URL line
( 5d) Example of Initial Query Form to search MULTIPLE Fields
( 5e) Example of Initial Query Form to search a RANGE
( 5f) Example of another O'Neil Technique
( 5g) Example of choosing Multiple names
( 5h) Example of choice containing a single quote character
( 5i) Example of giving 2 choices
( 6 ) Example of Passing Record Contents as Parameters on the URL line, also shows 2 hyperlinks.
( 7 ) Example of Excel Spreadsheet and a Transparent Table
( 8a) Example of using an Access Query (instead of a Table)
( 8b) Example of using an Access Query with parameters
( 9a) Example of Initial Filter Form
( 9b) Example of Initial Filter Form / Custom Form. Also suppress the Toggle Drop Button.
( 9c) Example of "Filter On Entry"
(10a) Example of dbRecordSet
(10b) Example of dbRecordSet (swap 2 columns)
(10c) Example of dbRecordSet (Sorted)
(11a) Example of Vehicles Table with Sorting a Computed Column.
(11b) Example of Vehicles Table using a Select Box with combined fields.
(11c) Example of Vehicles Table using a Start-Up Filter with DropDown Lists.
(11d) Example of Vehicles Table Charting a Calculated Column using "AS".
(12 ) Example of Table JOIN
(13a) Use of Background (WallPaper), Customizable Fonts, Filter Screen Title, and Error Message.
(13b) See the title colors on the filter screen. Also show use of Request("ASPdbClick_unit").
(13c) See how to customize the Sort Highlight Color -Both Title and Column.
(14a) Download TEST (csvhref.htm)
(14b) Example of Field Names for Downloads
(15 ) Example of Table WildCard
(16a) Example of MODE=DUAL-HORIZ, also Custom Filter Title.
(16b) Example of switching from Grid to Form using 2 different asp pages.
(17 ) Example of Custom Navigation Buttons.
(18a) Example of combined fields.
(18b) Example of combined fields with filter Drop-down list.
(19 ) Example of Email hyperlinks (also uses dbNameMap to put a comma in a column title).
(20a) Example of "GridForm".
(20b) Example of "GridForm" with NO Column titles.
(21a) Example of EasyFilterText=False
(21b) Example of Filtering when the AS clause is used.
(21c) Example of Filtering on the Same Field TWICE.
(21d) Example of Filter DropList using data from a table in another database.
(21e) Example of Filtering when the AS clause has a space in it.
(21f) Example of Filtering with truncated names on the drop list.
(21g) Example of Filtering fields with same name from two tables (ambiguous).
(22 ) Example of using the [Form+] to spread a Form across multiple columns
When things go wrong. See what happens when ...
(23 ) ... you have an EMPTY TABLE
(24 ) ... the MDB file is TRASHED
(25a) ... the MDB file is MISSING
(25b) ... the TABLE you requested is MISSING (or misspelled)
(25c) ... the DSN you requested is MISSING (or misspelled)
(26a) ... the ODBC DRIVER you requested isn't installed
(26b) .... the MDB file is READ-ONLY and you try to make a change
(26c) .... you have a Reserved Word in your Field Name an try to Update.
(27 ) Example of Drill-Down Details.
(28 ) Example of Memo Field with Custom Paragraph Markers and GridIndex numbers without Hyperlinks
(29 ) How to put the cell contents of the highlighted record into local variables (export them) and define the column widths of the Grid and Form.
(30 ) Example of Memo Field Export
(31 ) Example of Toggling Grid/Form with Background (wallpaper)
(32 ) Example of Column SUM
(33a) Example of Custom "Go There" button (w/MouseOver) & Defining Column Widths on the Form
(33b) Example of Hyperlinking using a New Target Window.
(34b) Example of Cars Database with Restricted Filtering
(35 ) Example of SelectDistinct
(36 ) Example of a Filter Validation Routine.
(37 ) Example of a Scrolling database.
(38 ) Example of a Search Filter in Left-hand Frame / Results in Right-hand Frame.
(39 ) Example of a JOIN having 2 Identical Fields.
(40 ) Example of unusual field names.
(41 ) Example of sorting columns that were renamed using the 'AS' clause.
(42 ) Examples of all the Pre-defined Color Schemes.
(44a) Example of a Customized Column Title when Column Spanning is used.
(44b) Example of a Spanning Two Columns, Sort Column Color, MagicCell on Memo.
(45 ) Example of a computing ELAPSED DAYS from Date fields.
(46 ) Example of a Left Justified Grid.
(47 ) Example of asking for an initial MODE.
(48 ) Example of asking for a LANGUAGE.
(49 ) Example of Students' Classes (Uses Languages, Codes, and Joins).
(50a) Example of the "Car Demo" from our Home Page.
(50b) Example of the "Car Demo" with user-defined bar chart scaling.
(51 ) Example of using var's to save, display, and pass grid data.
(53 ) Example, Startup Filter, Drop-Lists.
(54 ) Example of Filter using a Date Range.
(55 ) Example of using a BLACK Background. Also shows use of HeaderFontTag & CellFontTag.
(56a) Example of displaying a CSV TEXT File using a File DSN defined on-the-fly.
(56b) Example of displaying a CSV TEXT File using a pre-defined System DSN.
(56c) Example of displaying a CSV TEXT File when there are Blanks inside Field Names.
(57a ) Example of Remembering a User's Filter.
(57b ) Example of Sending a Filter to a Second Page.
(58 ) Example of using dbSilentCmdText to update records.
(59 ) Example of showing a Bool on a Custom Form.
(60 ) Example of finding records by successive Drill-downs.
(61a) Example of a Custom Index Column (Text) for Details.
(61b) Example of a Custom Index GraphicButton for Details.
(62 ) Example of defining CSV Date Formats.
(63a) Example of using JavaScript inside a dbMagicCell.
(63b) Example of using JavaScript inside a dbMagicCell to format TWO numbers in ONE cell.
(63c) Example of using VBScript inside a dbMagicCell.
(64 ) Example of displaying a photo on a custom form.
(65a) Example of using dbMagicCell to format a Memo field, and dbNameMap delimiters.
(65b) Example of using dbMagicCell to do more formatting tricks.
(66 ) Example of Searching for NULL and NOT NULL.
(67 ) Example of Forcing Grid mode after a Filter.
(68 ) Example of using OLEDB.
(69 ) Fill out a Survey Form using RADIO BUTTONS.
(70 ) Hiding Empty Fields in the Form in Dual-Horiz Mode.
(71 ) How to tell which field was sorted.
(72 ) How to Join 3 fields to 2 tables.
(73 ) Example of Access and SQL Server on the same page.
(74 ) Example of an Order By without an initial column hilite.
(75 ) Example of Orders / Order Details.
(76 ) Example of Replacing text using MagicCell also shows mouse-over.
(77 ) Example of using your own graphical Navigation buttons.
(78 ) Example of using Javascript to pop-up notes in another window.
(79 ) Example of Setting Filter Focus using BodyTag (and SendHead).

Pro Version Examples (primarily EDITING Examples) :

(101 ) Example of Database Adds/Deletes/Edits (Also shows default entries)
(102 ) Example of Database Editing in Grid only mode (also shows: Custom Update Button, Custom Edit Titles).
(103a) Example of Database Adds/Deletes/Edits with Memo Fields and "Field Notes".
(103b) Example of Database Adds/Deletes/Edits with Memo Field as Read-Only.
(104 ) Example of Editing Privileges based on UserID/Password.
(105 ) Example of Data Entry Validation Checking.
(106 ) Example of Editing Buttons in Form mode only.
(107 ) Example of Editing a Variety of Field Types. Also shows a scrolling Memo field
(108 ) Example of Editing with a Field Name containing a space.
(109 ) Example of Using a List from Another Table for data entry.
(110a) Example of Starting in EDIT Mode for ADDing records ONLY.
(110b) Example of Starting in EDIT Mode for EDITing a chosen record.
(111 ) Example of Updating MULTIPLE records.
(112 ) Example of Custom text on the Editing Buttons (also uses an 'AS' clause).
(113 ) Example of Editing when using the Table Wildcard.
(114 ) Example of using a DropList when Editing (also hide update criteria).
(115 ) Example of specifying larger edit boxes.
(116a) Example of specifying 2 or 4 digit years in Access.
(116b) Example of specifying a Future Date as a default entry.
(116c) Example of specifying the Date Format on the Edit screen.
(117 ) Example of hiding the various edit buttons.
(118a) Example of editing without an AutoNumber Field.
(118b) Example of Hiding the Update Criteria.
(119 ) Example of an Add Confirmation Screen (and how to Set Focus).
(120 ) Example of updating the Last Record and having it fall out of the WHERE.
(121 ) Example of protecting against unwanted HTML code inside a memo field. (also: 1,5 to 1.5)
(122 ) Example of a way to make a predefined field RO during Add.
(123 ) Example of a way to timestamp records (also non-sticky add).
(124 ) Example of adding/updating with droplists (also non-sticky add and multiple deletes).
(125 ) Example of Adding a Hidden Field (also non-sticky add and multiple deletes).
(126 ) Example of Editing when JOIN has duplicate field names.
(127 ) Example of "FULL SCREEN" Editing.

  APPLICATION EXAMPLES (ASP-db Enterprise)

Examples of Enterprise Features:

Look-up of indexed entries (relational database)

a) Conditional formatting of cells using an enhanced dbMagicCell property
b) Using dbMagicCell to "AND" two fields.
c) Using dbMagicCell to conditionally format a Bool field
d) Using dbMagicCell to conditionally format a NULL field

Different NameMaps for Grids and Forms.

a) Numeric Totals of a single column (and Export)
b) Numeric Totals of 2 different columns
c) Numeric Totals when a WHERE clause is used.
d) Displaying Min, Max, Average, and Total of a column
e) Numeric Total of a computed column
a) Better support for BLOB's (SQL)
b) Better support for BLOB's (ACCESS)

Allow record editing when a JOINED table is used
Able to Mark Specific Records "Shopping Cart" style!
Customizable Text for Everything (and display License Info)
Test for a Blank Table, then ...
Editing a Large Memo Field (also shows dressed-up text nav buttons)
Breaking up Navigation Buttons onto Multiple Lines
Exporting Formatted (vs. RAW) Cell Contents
Edit Button on Every Row
New Filter Screen
Have a Default field be Read-Only during an Add
Snaking Multiple Columns on Edit Screen. Also shows a Filter Select box.
Making a Custom Navigation Button (user function)
Edit when an INNER JOIN is used
Show User-defined text for True/False on Grid, Filter, and Edit screens.

Additional Application Examples:

APP-0) See a very simple example just to get you started
APP-1) See how to make a Look-up field be Read-Only (on updates)
APP-2) See how to format a Look-up field using dbMagicCell
APP-3) (Replaced with APP-7 below)
APP-4) See how to tell if you are in the Filter Mode (also hide the drop button)
APP-5) See how to use a Lookup field during a Delete (also export)
APP-6) See how to use Lookup fields during a Add
APP-7) See how to have 2 Timestamps (Created and Updated)
APP-8) See how to define ALT text on the navigation button images
APP-9) See how to define your own FILTER HELP SCREEN.
APP-10) See a StoredProcedure Example
APP-11) Passing Record contents to another Frame
APP-12) See how to add a "Hidden" Field
APP-13a) See how to define your own Search Criteria List
APP-13b) See how to Customize your Search Criteria List
APP-14) See how to turn off a DropList and type in your own entry
APP-15) See how to define your own Look-Up List
APP-16) See how to add a default Bool field
APP-17) See how to replace text using dbMagicCell
APP-18) See how to do a "Goto" on a Numeric Field.
APP-19) See how to put a DropList on an Add Template


  ASP-db GOLD EXAMPLES

TEMPLATE   Examples   (ASP-db Gold) 

1. Simple ASP-db Gold Grid (No Templates)
2. Simple Templates (Templates: Form, Filter)
3. Northwind Example (Templates: EditAdd, Update, and Graphical "Submit" Buttons)
4. True / False Field using Radio Buttons (and $ Currency) (Templates: EditAdd, Update, Delete)
5. True / False Field using a Check Box (Templates: Form, Update)
6a. FilterDropList (Templates: Filter)
6b. FilterDropList with a Blank in the DropList (Templates: Filter)
6c. Filter using Radio buttons on a Bool field (Templates: Filter)
6d. Filter using Toggling Drop-Lists (Templates: Filter)
7a. Look-up list during Add (Templates: Add)
7b. TWO Look-up lists during Add (Templates: Add)
8. Look-up (2 fields) during Form (Templates: Form)
9a. Specifying a default value during Add (Templates: Add)
9b. Ability to UPDATE or CLONE (Templates: Update)
10. Non-Sticky Adds: Text (with and w/o defaults) & DropLists (with and w/o defaults) (Templates: Add)
11a. Using DropLists for Add's and Updates, also Memo Field (Templates: Add, Update, non-sticky)
11b. Using a Drop list for an update (without using dbMagiclayout)
12. Adding a Hidden field (also shows a "Non-Sticky" Add) (Templates: Add)
13. Using an "IF CHECK" inside a Template (Templates: Update)
14. A very simple "LEVEL 2" Example (Templates: Send)
15. A very simple "2 Table Edit" Example

EMAIL   Examples   (ASP-db Gold)

1. Simple Email Example (Email a Simple Grid)
2. Simple Email Example (Email a Filtered Grid)
3. Another Email Example (Email a Form template)

CHART   Examples   (ASP-db Gold)

1. Simple Chart Example (Spinning Pie)
2. HyperColumn Chart Example (Drill down)

Validator, Calendar, Upload, DynaList   Examples   (ASP-db Gold)

1a. Validator Example
1b. Validator (Date) Example
2a. SuperCalendar Example
2b. SuperCalendar Example (2 calendars)
2c. SuperCalendar Example with Filter Validation
3a. SuperUpload Example (Blob)
3b. SuperUpload Example (File)
4. DynaList Example

Miscellaneous   Examples

1. Table WildCard
2. Specifying Field Title Tags and Goto Button
3. Edit Buttons on every row
4a. Accurate drill-down by BookMark
4b. Accurate drill-down by BookMark (Update)
5. Make your own LookUp List
6. Make a Field be read-only during Add
7. See how to have 2 Timestamps (Created and Updated)
8. See how to find out the IDENTITY of a NEW Record
9. Using the MATH Formula in MagicCell

 













Copyright 2003-2005. USIntertech, Inc.