Solved

Access pass-through query to sql

Posted on 2016-08-26
4
53 Views
Last Modified: 2016-08-29
I have a query functional and it uses a userdsn.  My problem is that the query in access continuously asks for a dsn validatioin everytime I do something to the results.  if I try to filter... it prompts.  if I try to sort... it prompts.
very annoying.

how can I set this up so that everything will continuously run in this access environment without always asking me for credentials.
the dsn is using a sql account that has read only access.

everything works great except for this
0
Comment
Question by:jamesmetcalf74
4 Comments
 
LVL 11

Assisted Solution

by:CraigYellick
CraigYellick earned 125 total points
ID: 41772075
Is the user DSN using a "trusted connection" or does is require a user name and password? If it needs a password, that would have to be part of the connection string.
0
 
LVL 2

Accepted Solution

by:
Antonio Salva Ripoll earned 250 total points
ID: 41772105
Hi jamesmetcalf74.

You can store the dsn, the username and the password in the query properties.

Open the query in the SQL view and select the Design tab. At the right you'll see the "Properties sheet" (I dont know the name it will have in your Access version, I use the Spanish version of Access 2010).

When you open the properties, you can modify the ODBC Connection String property.

In that connection string you can add the username and password adding the following
Uid=myUsername;Pwd=myPassword;

Open in new window


Also, check if you have the 'Trusted_Connection=Yes;' option.

Best regards.

Antonio.
0
 
LVL 36

Assisted Solution

by:PatHartman
PatHartman earned 125 total points
ID: 41772232
Here's a picture of a connection string in a pass through query.
 ConnectionString.JPG
0
 

Author Closing Comment

by:jamesmetcalf74
ID: 41774837
Thanks gents.
its working
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Viewers will learn how the fundamental information of how to create a table.

820 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