Solved

Pass thru query login question

Posted on 2008-06-18
3
217 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
3 Comments
 
LVL 10

Accepted Solution

by:
therealmongoose earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Excellent. Spot on.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
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.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now