Query Any/All Access Databases with one generic ASP page

Category:
ASP, HTML and XML
Type:
Snippets
Difficulty:
Intermediate

Author: Joe Meskey

Version Compatibility: ASP

More information:
This code snippet allows a user to run ad-hoc SELECT queries on ANY TABLE IN ANY ACCESS .MDB FILE without adding or modifying code.

To use, simply:

  1. save this code snippet as BROWSER.ASP to a ASP-enabled directory on your web server.
  2. Toss one or more .MDB files into the same directory [plus the standard ADOVBS.INC].
Now you're ready to go. Just fire up your browser and point it at BROWSER.ASP.

The program will first ask you to choose the desired .MDB file (from among those it finds in the current directory). From there you'll be asked to choose the desired table and the fields from that table that you want to display. A SELECT query is generated and the results displayed in a nice little HTML table.

Simple, generic and effective. Give your users a quick-and-dirty way to run their own queries over the web. Tell them you spent months on it! :)

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: