Solved

Access pass-through query to sql

Posted on 2016-08-26
4
45 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 34

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

708 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

13 Experts available now in Live!

Get 1:1 Help Now