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


May 08, 2006

Display Tables’ Contents in a Browser

RSS
Subscribe to Windows IT Pro | See More Database Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here

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.

End of Article



Reader Comments

You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...

Microsoft, News Corp. Discuss Locking Out Google

Microsoft and Rupert Murdoch's News Corp. recently discussed an alliance that would counter Google's fledgling online news service. ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...


Related Articles Script Inventories Remote Computers and Writes the Information to a Database

Related Events SQL Server Unleashed EMEA

Managing Multiple Databases Is Easier Than You Think

The Easiest Way to Save Time and Money on E-mail and SharePoint Management

Check out our list of Free Email Newsletters!

SQL Server and Database eBooks Safeguarding Your Windows Servers

SQL Server Administration for Oracle DBAs

Taking Control: Monitoring the Windows Platform Proactively

Related SQL Server and Database Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


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