Access pass-through query to sql

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
jamesmetcalf74Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Antonio Salva RipollConnect With a Mentor Commented:
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
 
Craig YellickConnect With a Mentor Database ArchitectCommented:
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
 
PatHartmanConnect With a Mentor Commented:
Here's a picture of a connection string in a pass through query.
 ConnectionString.JPG
0
 
jamesmetcalf74Author Commented:
Thanks gents.
its working
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.