Solved

Pass thru query login question

Posted on 2008-06-18
3
221 Views
Last Modified: 2013-11-27
I am connecting to a database to try to retrieve a report someone has written. The best way for me to do this is (i believe) through a pass thru query. I have pasted the SQL from the their report into my pass thru query and it works fine, the problem is everytime i run this query i need to do the ODBC settings and enter the username and password to access the external database. Obv this is no good when clients are using the database.
Is there a way around this?

Many Thanks,
Dean
0
Comment
Question by:deanlee17
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
therealmongoose earned 500 total points
ID: 21813953
Yes - if you set up a saved query as an odbc query and go into the query properties (right click the blue bar at the top of the query screen), you can set the odbc connection str (click on the right of the field to show the button with "...") when you've selected the appropriate odbc connection, click save - you'll be asked if you want to save the password and user name with the query - that way you don't need to keep re entering the details...

As an aside, it's best to use a file dsn rather than a machine dsn for this type of connection - that way you can run the query on any machine.....
0
 
LVL 4

Expert Comment

by:shekharsom
ID: 21814064
The best way is either:

1. change the query string to include username and password.

or

2. create a dns
0
 

Author Closing Comment

by:deanlee17
ID: 31468411
Excellent. Spot on.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question