Unable to connect to a migrated Access database on SQL Server as another user: SQL server Error 4060 - sql

I have an Access DB that I migrated to SQL server recently. The SQL server is on a Windows server. Now I can work normally with the SQL database but when others log into the same windows server with their credentials they are not able to access the database. As soon as they open Access frontend they get an error saying failed connection. Now I created an ODBC connection string(File DNS) and gave it to the other users in the network but they still are not able to connect to the database. They get an error stating "SQL server connection failed. The server rejected the connection: Access to the selected database has been denied". Can someone please help me to solve this issue so that multiple users can connect to the SQL DB without any issues? Thanks

Hard to know with the limited information. Are you using windows authentication to sql server, or are you using SQL logons? Either should work fine. The other issue to watch out for is what sql driver did you use to link with?
If you link say using the native 17 ODBC driver, then that is not installed on workstations by default - you have to download and install that driver.
Or, maybe you linked using the long time "legacy" sql driver - that is by default installed on all workstations.
So, it not clear if you using SQL logons, or using Windows authentication for the connection to the database????
If your using windows authentication, then all those other users will require permissions to be granted to the database.
If you using a SQL logon, then that logon would have been saved when you link the table(s), and again it should work for all users. Its quite common to create ONE logon on SQL server, link using that logon, and thus all users will be connecting to the database using the one same logon id/password.
And, if you linked using a FILE dsn, then zero configeration should be required, since access converts FILE dsn's into what are called dsn-less connections. (the origonal file is not required anymore once you link - you can even delete that FILE dsn, and it will still work).
So, FILE dsn is the best choice, since that dsn is NOT required to be setup on each workstation.
And if you using sql logon's, then make sure you checked the box to remember the password during linking of the tables. That is this check box:
And note during a re-link the above box does not appear - only on first time linking of table(s).

Related

Access 2010 - Connecting LocalDB to Microsoft Access via DSN

I have created a local db and I want to connect some tables to Microsoft Access. I'm doing this via Microsoft Access's "Link to the data source by creating a linked table" feature" and in order to do that I need to create a DSN. However I'm getting an error where it says
"Server does not exist or access denied"
At the moment I'm trying to create a new DSN and i'm stuck during the below step which I need to specify my server. I've tried two different server names and they both don't work.
Note: It's definitely not an access denied issue because I've tested the login myself and they all work fine.
Can someone please tell me what I'm doing wrong or is it not possible to link Access to a local db.
Resolution
When choosing a driver for the new data source, use either the ODBC Driver...for SQL Server or the SQL Server Native Client. (note: I am also able to get the "SQL Server" driver to work, but only by specifying the named pipe address of the instance in the next step/image where specifying the SQL Server to connect to.)
The SQL Server to connect to in the "Create a New Data Source to SQL Server" should be "(LocalDB)\instancename"; in this case "(LocalDB)\MSSQLLocalDB"
Caveats
As the LocalDB name itself implies, connections to it can only be
made from the local machine. If you need to access an instance on a
different machine, and need a free solution, you should use SQL
Server Express.
These results were obtained using Access 2016. My
experience with other software indicates it should work with Access
2010 as well, but I did not test that. If you have trouble, try using
the named pipe address for the instance instead of the
"(localdb)\MSSQLLocalDB" moniker in the image above.
Results
Here are the results of testing the connection, then adding links to two tables in the master database
Instead of using a LocalDB I used SQLExpress which worked fine.

Connecting access 2007 to sql server 2012

I've linked to a table in an sql server 2012 database using an odbc connection. This was straightforward and worked fine using my log in. When I attempted to open the linked table on another users computer I got an error saying I could not connect. I tried to set up the connection on their PC but couldn't see the database on the server. I logged on to sql server and gave that user a log on to the sql and access to the database using windows log in.
I still could not gain access to the database through access. Any idea what I'm doing wrong.
One Idea, you shall create all linked tables with a privileged user account of the SQL Server.
For example, if you enabled Trusted_Connection in the SQL Server, you can use the administrator's account of Windows, for example, johndoe2 for connection. If your SQL Server is installed on the LAN host masterserver, a linked table can be created as this:
ODBC;DRIVER=SQL Server;SERVER=masterserver\SQLEXPRESS;Database=[MyDatabase];UID=johndoe2;Trusted_Connection=Yes;TABLE=dbo.[MyTable]
In our case we can access MyTable throuhg Access 2007 on the host biomas that is on the same LAN as the masterserver.

SQL Server 2008 - Reporting Services Failed Login for User '...'

Good Afternoon,
I'm having difficulty running a report with a data source saved on the Report Server using credentials for a user I created on SQL Server named 'ReportUser'. Attempting to resolve this I've mapped the user to the 'ReportServer' database with the db_owner role as well as setting the default database to the 'ReportServer'. However, each time I attempt to run the report I receive the error message:
Cannot create a connection to data source 'Test'. Login failed for user 'ReportUser'.
I'm running SQL Server 2008 from my local machine and am able to successfully run the reports when I setup the datasource using Windows Authentication. Any idea on what could be causing the issues when attempting to use the SQL Authentication with the 'ReportUser'
Thank you very much for your help!
Thank you for your reply.
I believe I found the cause of my issue. Since this was a local install for testing purposes I just set up the instance of SQL Server with Windows Authentication. However, I made the mistake of not setting up the server for both Windows and SQL Authentication. The following link helped me resolve this.
http://forums.asp.net/t/1784261.aspx/1?Could+not+connect+to+database+login+failed+for+user+sa
After changing this setting and restarting the SQL Server everything appears to be running properly now.

Connection via ODBC to SQL Server failing

I have a strange issue. I can connect from one Terminal server to the SQL server as an admin. I can also connect to the server via a straight SQL connection as a normal user. When I try and log on to the server using odbc I receive the following error.
07/08/2011 10:49:14,Logon,Unknown,Login failed for user ''. Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only. [CLIENT: 10.0.0.25]
07/08/2011 10:49:14,Logon,Unknown,Error: 18456 Severity: 14 State: 58.
The SQL server is definitely in mixed mode and a user is definitely set up in the connection. It must be a permissions issue.
Probably the user that tries to login does not have permission to the database he/she is trying to connect.
Go to the SQL Server > Security > Select the User - Right Click > Properties > User Mapping
And there select the database that user needs to access (check box in the map column)
I'm pretty sure that error had happened to me before that that's how I fixed it. Assuming it is true that your server is setup as mixed mode already.
If your using ado.net, make sure your using the ODBC data adapter, connectors and odbcCommands instead of the SQL ones. ;)

CF9 + SQL Server Express

I just created a new database in "Microsoft SQL Server Management Studio Express" and now I'm in "ColdFusion Administrator" and I'm trying to add my database as a Data Source. How do I do that? I believe the servername is .\SQLEXPRESS but I'm not sure what the default username and password are. I've tried creating a new login through Management Studio with an actual username and password, but those aren't working either. The error I'm getting is:
Connection verification failed for data source: xxx
java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
The root cause was that: java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
I can see that the service is running, and I can connect to it through management studio. I've tried following a couple tutorials online, but they don't seem to be working for me. Ideas?
Server name can be any resolvable hostname or domain name, in case of having SQL Server and CF server on same box localhost should work for you.
Also make sure that user you created has access to the particular database and needed operations. Look into the database permissions for this. This check is not required when using master account (often login is sa), but this is not recommended practice because of the security reasons.
Also make sure SQL Server and Windows Authentication mode is checked. I had an issue with permissions as well when I only had Windows Authentication enabled under:
right click on server (localhost) -> security
Then restart SQL Server Services to save changes. After that I was able to connect my ColdFusion datasource to SQL Server.
For testings sake use the same credentials that you are connected with in Management Studio, likely the "sa" user and password. Once you have it working with "sa" then go back into Management Studio and create an application level user for your CF app and then update the data source to use your new user / password.