Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Pass thru query login question

Posted on 2008-06-18
3
Medium Priority
?
224 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

704 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