mistux Site Admin
Joined: 25 Jun 2004 Posts: 1042 Location: South Bend, Indiana USA
|
Posted: Mon Aug 25, 2008 12:45 pm Post subject: Creating the SQL Pass-Through Query Access 2002-03 |
|
|
In the Database window, click Queries under Objects, and then click New.
2. In the New Query dialog box, click Design View, and then click OK.
3. Click Close in the Show Table dialog box without adding any tables or queries.
4. On the Query menu, point to SQL Specific, and then click Pass-Through.
5. On the toolbar, click Properties to display the property sheet for the query.
6. In the query property sheet, place the mouse pointer in the ODBC Connect Str property, and then, click the Build (...) button.
With the ODBC Connect Str property, you specify information about the database to which you want to connect. You can type the connection information, or click Build, and then enter information about the server to which you are connecting.
7. When you are prompted to save the password in the connection string, click Yes if you want the password and logon name to be stored in the connection string information.
8. If the query is not the type that returns records, set the ReturnsRecords property to No.
9. In the SQL Pass-Through Query window, type your pass-through query. For example, the following pass-through query uses the Microsoft SQL Server TOP operator in the SELECT statement to return only the first 25 orders in the Orders table from the sample Northwind database:
SELECT TOP 25 orderid from orders
10. To run the query, click Run on the toolbar. (For a SQL pass-through query that returns records, click View on the toolbar.)
11. If necessary, Microsoft Access prompts you for information about your server database. |
|