Microsoft Access
  Home arrow Microsoft Access arrow Page 4 - On Using Pass-through Queries in MS Access
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MICROSOFT ACCESS

On Using Pass-through Queries in MS Access
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 18
    2006-07-03

    Table of Contents:
  • On Using Pass-through Queries in MS Access
  • Providing the ODBC Connectivity information
  • Creating a Query
  • Saving Connection information with the query

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    On Using Pass-through Queries in MS Access - Saving Connection information with the query


    (Page 4 of 4 )

    It is possible to store the connection information as follows: open the passthru query in the design view, then right click on the title of the query to open the next window. As you can see the ODBC connection string is not complete. Now click in the empty area to display an ellipsis button. When you click this button you will get the Select Data Source window. Choose the dsn file from there and click on the OK button. In the window that follows, provide the authentication information and click on the OK button. Now this connection string item gets filled, and if you save the query, the connection information will be saved with the query.

    But before that you will get a message that asks whether you want the connections string saved with the query.

    When you accept this, the following connectivity information will be saved with the query.

    ODBC;Description = Using SQLClient for a Passthrough query; 
    DRIVER=SQL Native Client; SERVER=HODENTEK; UID=sa; PWD=XXXXXXX;
    DATABASE=Northwind; LANGUAGE=us_english;

    The password will be saved in clear text (but this has been replaced by the xxxxxxx in this document). Now you can run the query without needing to provide connectivity information. However, for security reasons connectivity information should not be saved with the query.

    For the next passthrough query in the same database, you may copy and paste the connection string, but change the SQL query statement in the design pane to achieve the desired result as shown for this query, Top10.

    Select top 10 *
    from employees 
    where birthDate >'1-1-1960'
    
    When yo run this query you should see the following result.

     

    Summary

    In connecting to a SQL server on another machine you will need authentication as well as permissions on the object. Even with these correctly entered, you may get errors if the TCP ports to the server are blocked for some security reason such as a firewall. Again, for security reasons, it is not advisable to store the authentication information with the query. A passthru query may be a better option than linked servers as it reduces an intermediate layer.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · I once worked for a Networking company in Virginia who were sub-contracting us to...
     

    MICROSOFT ACCESS ARTICLES

    - Linking SQL Express 2005 Tables to MS Access...
    - Working with Access Projects in Access 2007
    - Exploring Access 2007
    - Working with Stored Procedures in an MS Acce...
    - Creating and Using Action Queries
    - Creating Data Access Pages with Charts using...
    - Advanced Ideas using VBA
    - VBA Details
    - Updating Records in MS Access
    - Using ADO`s Record Object with URLs
    - Exporting XML from MS Access 2003
    - Importing XML into MS Access 2003
    - On Using Pass-through Queries in MS Access
    - Distributed Queries in MS Access
    - Configuring a Linked Microsoft Access Server...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT