65.9K
CodeProject is changing. Read more.
Home

Quick-and-Dirty Testing of Microsoft Access Queries

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.67/5 (3 votes)

Jan 29, 2014

CPOL
viewsIcon

23568

How to query Microsoft Access tables

Access Data in a Microsoft Access Database

Say what you will about it, Microsoft Access is still widely used (and abused?)

At any rate, if you work with Microsoft Access, you may want to run a query against it to see what data you will get or to perform a sanity check on your SQL statement. To do so is easy, but not necessarily intuitive.

Just follow these steps:

  1. Open MSAccess by 2-clicking the appropriate .MDB file (the database you want to query)
  2. Select the "Create" tab
  3. Select the "Query Design" icon
  4. Mash the "Close" button on the "Show Table" dialog
  5. Right-click in the query window and select SQL View
  6. Enter your query in the window (overwriting the default "SELECT;")
  7. Mash the Run button (red exclamation mark) on the Design tab
  8. Gaze in wonder at the data returned, batting your eyelashes coquettishly if you're a chick or pounding your chest thunderingly if you're a cat.

Note: This works for Access 2007; other versions of Access should work similarly.