Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


Return to article

Display Tables’ Contents in a Browser
 

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.







Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement