Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access pass-through query to sql

Posted on 2016-08-26
4
Medium Priority
?
58 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:Craig Yellick
Craig Yellick earned 500 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 1000 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 40

Assisted Solution

by:PatHartman
PatHartman earned 500 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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
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.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

886 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