Strange MS Access error related to SQL Server User Permissions - sql

Im having a strange issues in an MS Access database that links to SQL Server 2008. In the database, I have a function that is called on start up to add a record to a table. When doing so, I get an error of "OBDC Connection Failed". After doing some testing, I was able to find that if the user within the database is a "db_owner" they are allowed to add the record without any issues. However, if they are a "db_datawriter/db_datareader" they cannot.
Anyone have this issue before?

Related

Can’t See Sql Databases After Creating in VSPM

I am attempting to create a new database in an existing sql server from code first. I used package manager to enable migrations, add a migration, then update database. The three methods executed without any errors and I got the traditional massages afterwards. However, when I look in either MSSSMS or Server Explorer I don’t see the database. I tried re-running the update database command and got the migration has already been applied. Any suggestions?
Update:
I've figured out that the project is adding the database to localdb. However, I have a connection string in the app.config file.
Probable causes are:
the database was never created
you use a login that can't see the database. Using Windows authentication/sa might allow you to see it and create user mappings for other logins.
you have multiple instances of sql running and you're connecting to the default instance while the database what created on a named instance
you accidentally created the database on another server
you connect to master by default with your software and instead of creating a database the database structure was created in the system database master
I've been working with MS sql for more than a decade and have struggled with issues like these, but in the end I could always explain what happened; if SQL returns it executed a query succesfully id did.

"The server principal is not able to access the database under the current security context," but user isn't accessing that DB

There are a ton of threads about this error, but I can't find an answer for what I'm dealing with. I have a simple view in DB1 and a user that has permission to select from it. It's not a cross database script. Just a simple SELECT from DB1 only. The server has recently been migrated to 2016 (from 2008) by a vendor and everything was working fine until recently when I would get this error sporadically, but about not having access to DB2. That user is not looking at DB2 at all and again, no cross-database SELECT. This now has also happened to another user. I just can't figure this out. Any ideas?
Thanks!

SQL Server login error over ODBC connection

I'm working on a project using SQL Server 2012 and I am running into an issue while attempting to update a login.
I was attempting to add DDL permissions to a login and when I went to hit OK and close the properties window, I received this error.
I closed the login properties window and reopened it to find that the login's database role changes had indeed been updated to reflect the changes I made.
It looked to me like my changes had been committed, and then this error popped up.
I went to connect over an ODBC connection I had made earlier for the same login, but discovered I no longer could, I was getting this error from the ODBC.
I know for a fact that this ODBC connection was working for this login at some point before my changes since I had a linked table that was using this same connection. It was able to both pull down updates from the SQL Server and push through changes back up to the server level.
Can anyone help shed some light onto what a solution to these errors may be? I assumed they were related since they both began occurring this morning, but I'm not positive of that fact. My database administrator is out of the office till tomorrow, so I'd really like to get this resolved before then.
This is what I get when I try to use that logon through SSMS
I'm putting this into an answer, since it solved OP's problem. I don't know what happened during/after the initial error (when granting DDL permission), nor exactly what the other errors were pointing to.
Because the user was unable to login through ODBC or SSMS, the first step would be to check the user and login properties in SSMS, to ensure that, for example, it is enabled, and that it was granted permission to the database.
In the comments, OP found that the user was not setup with GRANT.

SSAS anonymous access Cross Domain Access

I'm trying to configure anonymous access to SSAS accross domains. Well at least that is what I think I need to do to solve my business problem. I've attempted all the steps on here
http://support.microsoft.com/kb/324040
http://www.ssas-info.com/analysis-services-faq/29-mgmt/2670-q-how-to-setup-ssas-anonymous-authentication-to-access-data-from-internet-or-another-domain
to no avail.
Let me explain my situation I've got a SQL Server running SSAS and then a development server with access to database server. I would like a user that doesn't have access to SQL server box to be able to open Excel spreadsheets that connect to the SSAS server. So they can browse the data. I've found that the user on the development server also has to be the exact same user name and password on the SQL server. This might not be the worst solution I was just wondering if anyone knew about a better way.
On another note being a bit of an SSAS newb what is the best way to expose a data cube on the web? Any good resources for this would be very helpful.
If the user doesn't have credentials on the SSAS server I get this error
"An error was encountered in the Transport Layer" Followed by this ever so informative error
"Errors in the OLE DB provider. An error occorred while loading the connection dialog box component for prompting."
Thank you

Permissions Problems Prevent Database Access

Recently I inherited a database from another programmer (created / stored with SQL Management Studio 2008), and I am having massive difficulties accessing, modifying, or even viewing the previously created databases.
Specifically, when I try to load one of the databases in SQL Management Studio I get the following error message:
"The database [database name] is not
accessible. (Object Explorer)"
I am connecting to the SQL server with windows authentication.
Anyway, is this a permissions issue left over from the last dev? (he's unavailable, unfortunately) And is there an easy work-around short of completely reinstalling SQL Management Studio?
Edit: Update:
Upon trying to access User Mapping, as suggested below, I got the following error message:
"One or more databases are inaccessible and will not be displayed in list."
Unfortunately, none of the databases I am trying to access appeared in the list, so I assume they are still inaccessible.
It could very well be a permissions problem. If you open Object Explorer in SQL Server Management Studio and expand the Security node (the one under the server instance, not the Security tab under the individual databases) and then expand the Logins node you'll see the list of logins that have been created on the server. Have a look at the properties of each of those and check out the User Mapping information. You'll be able to see which logins are mapped to which databases. It's possible the previous programmer only granted access to the database to certain logins. If you find a login that's mapped to the database you want, try changing the password of the login and then connecting to the database with that login and password. NOTE: be careful when changing the password as it may affect production applications that are using that login and password!
This message:
"One or more databases are inaccessible and will not be displayed in list."
Means that the user you are using right now cannot access to that db. If you can enter with a user that does have access and from that user change your actual user's rights through User Mapping, then you will see it.
You need a dba (or someone with dba equivalent access) to give you rights to the database.