StarQuest Technical Documents

How to Create a SQL Pass Through Query in Microsoft Access

Last Update: 26 June 2008
Product: StarSQL
Versions: 5.x
Article ID: SQV00SQ028

Abstract

This technical note explains how to create a SQL pass-through query in Access 2003 and 2007.

A pass-through query allows you to send SQL statements directly to DB2; the tables accessed do not need to be linked. A pass-through query is useful for those who wish to bypass the Microsoft Access JET Engine.

Solution

  1. Open a Microsoft Access Database.
  2. For Access 2003, click the Queries tab and select New, Design View. For Access 2007, click the Create tab and select Query Design.
  3. Close the Show Table dialog without selecting any tables.
  4. For Access 2003, from the Query menu, select SQL Specific, Pass-Through. For Access 2007, click the Pass-Through Query button on the toolbar.
  5. In the SQL Pass-Through Query dialog, type your SQL statement.
  6. To run the query, click Run (the red exclamation point) on the toolbar.
  7. You will be prompted to select the StarSQL data source to use to run the query. Double-click the appropriate data source, enter in a User ID and Password, and click OK to connect.

DISCLAIMER

The information in technical documents comes without any warranty or applicability for a specific purpose. The author(s) or distributor(s) will not accept responsibility for any damage incurred directly or indirectly through use of the information contained in these documents. The instructions may need to be modified to be appropriate for the hardware and software that has been installed and configured within a particular organization.  The information in technical documents should be considered only as an example and may include information from various sources, including IBM, Microsoft, and other organizations.