- In the Database window, click Queries
under Objects,
and then click New on the Database window toolbar.
- In the New Query dialog box, click Design View, and then click OK.
- Without adding tables or queries, click Close in the Show Table dialog box.
- On the Query menu, point to SQL Specific, and then click Pass-Through.
- On the toolbar, click Properties
to display the query property sheet.
- In the query property sheet, set the ODBCConnectStr property to specify information on the database to which you want to connect. You can type the connection information, or click Build
, and then enter information about the server you're connecting to.
When you are prompted to save the password in the connection string,
select Yes if you want the password and logon stored in the
connection string information.
- If the query isn't the type that returns records, set the ReturnsRecords property to No.
- In the SQL Pass-Through Query window, type your pass-through query.
For details on the syntax for your query, see the documentation for the SQL database server to which you're sending the query.
- To run the query, click Run
on the toolbar. (For a pass-through query that returns records, you can click View
on the toolbar, instead.)
If necessary, Microsoft Access prompts you for information about your
SQL server database.