December 23, 2013 at 1:31 am
hi
I worked on a project with Visual Studio that I need to connect to my DB which is created in SQL server 2012.
I make a connection in server explore in VS but when i select my db it give me an error that i don't have permission to access the file !
I don't know what's wrong, even I try new instance in SQL but it doesn't work, and I use windows authentication in sql.
it's really kind of u if u can help me about this. 🙂
December 23, 2013 at 5:58 am
What permissions do you have on the SQL instance and database?
Connect to the instance using SSMS and confirm you can navigate the database objects, confirm your level of access at both the server and database level using an administrator login.
December 23, 2013 at 6:11 am
your Window User do not access to that particular DB. For the sake of connectivity you can use SQL Authentication Mode for that db.
December 23, 2013 at 10:33 am
i think it's full access, i mean i don't change any special thing...
how can i check an instance access !?
about SQL authentication, if i choose it in VS it's just ask me that username and password ?!
December 23, 2013 at 3:05 pm
By default, windows admins do not get access to the SQL instance. You need to specifically grant access during installation. If you used the default during installation, you need an Administrator login to grant your windows user access to the instance via SQL management studio.
This is the install screen where you initially grant who can administer the SQL instance:
If you can get into SQL management studio and connect as administrator (or sa if you chose mixed mode authentication), then run:
CREATE LOGIN [domain\user] FROM WINDOWS
GO
sp_addsrvrolemember 'sysadmin','domain\user'
GO
That's assuming this is a development instance. If you are setting up a production system, contact the owner for access.
December 24, 2013 at 11:41 am
thank for ur clearly explanation 😉
i think it's work 🙂
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply