Solved

Pass thru query login question

Posted on 2008-06-18
3
220 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
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

830 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