Cannot Connect to SQL Server 2012 Express database via MS Web Developer 2010 Express
-
Thursday, April 05, 2012 8:24 AM
I researched all the past answers but the menu items aren't the same (or I'm too new to understand what the answers are saying.)
I installed SQL Server 2012 Express on my home Win7 computer and have created a database probably with all the defaults (except I chose SQL Server and Windows Authentication mode option.) The database has its tables and stored procedures all set up nicely and I'm ready to connect to it.
When I switch to Visual Web Developer 2010 Express and click on the "Connect To Database" icon on the Database Explorer window and try to connect, I get the message that I don't have permission to connect to the database. The database is on the same machine that has the VS installed.
I've chosen "MS SQL Server Database File" and click on Continue. I've tried to use Windows Authentication and tried to use the username and ID I added to SQL Server prior to browsing to the database but I get the same error. I also tried the SA account and password. Integrated Security is set to True. I tried connecting using the User Instance setting set to both true and false (I have no idea what I'm doing. I'm just trying different things I think I've seen in other posts.)
The exact message is "<database name> You don't have permission to open this file. Contact the file owner or an administrator to obtain permission."
Can anyone help me connect to the database? Thanks!
All Replies
-
Thursday, April 05, 2012 10:12 AM
please use SQL Server Configuration Tool to check that SQL Express is running and what exactly the instance name is.
Try SQL Server Management Studio Express to connect to the SQL Express instance found above.
Does Visual Web Developer 2010 Express allow to connect to a SQL Server (Standard or Express) or does it allow to open SQL Database by builtin SQL engine?
-
Thursday, April 05, 2012 6:13 PM
I opened the Config Mgr and it is running. I see the column "Log On As" is set to "NT Service\MSSQL$KIMREY". I opened up properties and changed the password to make sure I knew what it was. I *think* the instance name is KIMREY. It's the name in parenthesis anyway.
I've always been able to connect via Mgmt Studio. It's how I created the database.
As far as I can tell, yes, Visual Web Dev allows a connection. When I click on the create connection button, I have several choices including:
- Microsoft SQL Server (to connect to SQL Svr 2005 or above or Azure)
- MS SQL Svr Db File (to attach to a adb file to a local MS SQL Svr instance, including Express)
I've tried both but neither work. Using the second method, I used the new logon name I mentioned above. That was new. That still didn't work. Grrr. You would think this would be much more simpler. I need a network degree to figure out how to connect to a local instance.
-
Thursday, April 05, 2012 9:09 PMI see my instance ID is MSSQL11.KIMREY. Not sure what to do with that though.
-
Thursday, April 05, 2012 9:46 PM
You mean Visual Web Developer? Look at this:
http://www.connectionstrings.com/
Specifically, look at this:
http://www.connectionstrings.com/sql-server-2008
Take a look at this:
http://www.youtube.com/watch?v=SyEV6oJI6Bw
Does that help???
Ryan Shuell
-
Thursday, April 05, 2012 11:08 PMThanks, but those didn't help. I know the format on how to make the connection string and how to go through the menus. The problem is when I fill it all out it tells me I can't connect.
-
Friday, April 06, 2012 11:34 AMModerator
Hi Llamagirl,
Please, could you explain exactly how you have created your database ? ( from VWD, SQL Server Management Studio Express or SSMSE in a shorter way ) and especially where the datafile ( .mdf) of your database is as folder ?
Are you able to browse your database with SSMSE ?
Please, when you are trying to connect to your database thru VWD, i suppose you are trying thru the DataSource Wizard.So , in the form you have selected your .mdf file, you should see in the right bottom part ( just above Cancel or OK ) a button labelled Advanced .Click on it and tell us what are the values of the properties ( especially user instance ) ?
Are you sure that, in VWD, you are using the same Windows login with which you have created your database ?
We are waiting for your feedback to try to help you more efficiently.
Have a nice day
Mark Post as helpful if it provides any help.Otherwise,leave it as it is.
- Marked As Answer by amber zhangModerator Thursday, April 12, 2012 1:48 AM
-
Friday, April 13, 2012 1:19 AM
Not much help coming from Microsoft Support team and experts like MS SQL.
Anyway after 5 days of struggle here is the answer I tried it now on two machines and it works
First Open SQL configuration manager [ you will find this in the Start > Programmes > Microsoft SQL server 2012 > Configuration Tools
Select SQL Server Network Configuration > Then Protocols for SQL Express - On the right window you will see the 3 protocols all showing "Disabled" Right click and select ENABLE on all 3
Once done right click again on Protocols for SQL EXPRESS in the Menu window and click REFRESH
Then select TCP/IP Right click and select properties - In the pop-Up window select IP Addresses - Starting at IP 1 [ Delete the 0 in the TCP Dynamic Ports cell so it is BLANK. In the TCP Port cell below type in this port number 14330 [ this should be open] Do this all the way down to the bottom where it ends in All Ports
[You may have to check your firewall to see if this port is not blocked - if so allow ]
Again REFRESH
Go Back to Select SQL Servers Services in the Menu [ in the right window you will see 5 servers application the bottom 2 SQL Agent and SQL Browser shows red square - Stopped
Select Agent- right click and select properties then select SERVICE tab and set Start mode to Automatic - click apply - then REFRESH
[ I clicked the START button at the top, but it times out because my PC speed not the best - don't worry it will have no affect on the final outcome]
Select Browser right Click then first click START then select Properties set the Start Mode to Automatic - REFRESH.
You will now see green arrows on 4 of the 5 server applications.
Reboot
And it should work
very drawn out but in practice it is rather quick
NOT BAD FOR A BEGINNER - I have had no SQL training and this is my first try
- Edited by WHAT KIDS WANT Friday, April 13, 2012 1:23 AM
- Edited by WHAT KIDS WANT Friday, April 13, 2012 1:25 AM spelling
- Proposed As Answer by DanRawr Sunday, March 24, 2013 1:19 PM
-
Monday, April 30, 2012 6:17 PM
Thanks, but those didn't help. I know the format on how to make the connection string and how to go through the menus. The problem is when I fill it all out it tells me I can't connect.
hello Llamagirl
have you solved your issue with SQL Express and MS WebDeveloper ?
if not we can provide you with more information about issues for VS IDE and SQL Express.
Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.
-
Monday, April 30, 2012 7:08 PMModerator
Hello,
I think that i have missed something in the thread.
In your last post, you have written
"Select Agent- right click and select properties then select SERVICE tab and set Start mode to Automatic - click apply - then REFRESH"
Have you tried to start up the SQL Agent service on a SQL Server Express ? It is impossible to use the SQL Agent Service on a SQL Server Express Edition as it is disabled for this edition. It exists only to make easier the upgrade of an Express Edition towards a not free edition like Workgroup or Entreprise.A little remark : it was different with SQL Server Express 2005 because it was not installed even in a disabled state, with problems during the upgrade towards an Entreprise Edition.
Anyway, i found an article simple but full about the way to connect to a SQL Server :
http://www.mssqltips.com/sqlservertip/2661/how-to-connect-to-a-sql-server-named-instance/
Maybe, it could help you.
I have not liked
"Not much help coming from Microsoft Support team and experts like MS SQL"
For the moment, it is true that nobody from Microsoft seems to have tried to help you ( i am not from Microsoft, but maybe, it is because your problem is not related to SQL Server Express but SQL Server Data Access. A moderator can move your thread towards this forum( for myself, i could do it but i prefer to get the agreement of the original poster that's to say you ) .No thread to recreate, no lost post. You have to do a choice now. On this new forum, maybe a person from the SQL Protocols team will help you.
We are waiting for your feedback to try to help you more efficiently.
Have a nice day
Mark Post as helpful if it provides any help.Otherwise,leave it as it is.
-
Monday, April 30, 2012 10:14 PM
I finally resolved it. I had SQL Server 2008 Express installed alongside SQL Server 2012 Express. Once I uninstalled SQL Server 2012 Express, things worked fine. I believe the SQL Browser couldn't resolve having those two versions installed and running because I went into services and found the SQL Browser service would not start. Once I uninstalled 2012, it started up and everything worked fine.
Thanks all!
- Marked As Answer by Llamagirl Monday, April 30, 2012 10:15 PM

