Display Tables’ Contents in a Browser

The QueryTable.vbs script lets you query a table on a local or remote database server and display that table’s contents in a browser.

Readers

May 7, 2006

1 Min Read
ITPro Today logo in a gray background | ITPro Today


I wrote a script, QueryTable.vbs, that queries a table on a local or remote database server and displays that table's contents in a browser. I needed this script when I was visiting a remote machine with no client database access tools but needed to see contents of certain tables.

Listing 1 shows an excerpt from QueryTable.vbs. (You can download the entire script from the Windows Scripting Solutions Web site.) Here's how the script works: After declaring the database and table variables and setting database connection parameters, the script connects to the specified-table and retrieves the table's fields and their values. The script then creates the QryResults.html file and writes the table's contents in that file.

To use this script, you need to customize the DataSrc, DBName, sTable variables' values in the code that callout A in Listing 1 shows. QueryTable.vbs is fully customizable and not limited just to one type of table or one type of database server.

—Arthur Zubarev

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like