Solved

sql express connection

Posted on 2010-08-24
20
824 Views
Last Modified: 2012-06-27
Page Name = SQL Server Authentication mode



 I have not set any user name password for the DB but somehow I cannot connect via this software.see attachment

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


--------------
On Asp.Net pages I connect like this and it works fine.  
        connectionString = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=SADB;Data Source=KENLAPTOP\\sqlexpress";

sqlconnect.jpg
0
Comment
Question by:goodk
  • 9
  • 7
  • 3
  • +1
20 Comments
 
LVL 17

Expert Comment

by:Chris Mangus
ID: 33516478
1.  Check your connection string.  You may have one too many slashes in your source.
2.  Is the application you're connecting with on the same server as SQLExpress?
3.  If not, have you configured SQL Server to allow remote connections?
0
 
LVL 58

Expert Comment

by:cyberkiwi
ID: 33517095
In the CMS web setup screen, you need
KENLAPTOP\sqlexpress
not
KENLAPTOP

Since no login/pass is provided, it will attempt to authenticate as the Identity of the App pool running the CMS web app.
0
 

Author Comment

by:goodk
ID: 33517877
ok, a little progress but
now I do not know how to connect to the database? when I tried to connect I get the following error,
The database 'SADB' doesn't exist!
I am confuse - ??
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 58

Expert Comment

by:cyberkiwi
ID: 33517897
[Since no login/pass is provided, it will attempt to authenticate as the Identity of the App pool running the CMS web app.]

What windows account is being used to run the App pool in IIS for the CMS app?
If this is ASP.Net, you need to check the ASP.net identity instead.

That windows account probably doesn't have access to the SADB database.
0
 

Author Comment

by:goodk
ID: 33517909
I am the only user on this computer with only one admin account
 
I also tried creating a database but had an error!!
My asp.net pages work just fine with the database.  Not sure what is going on?
0
 
LVL 33

Expert Comment

by:ste5an
ID: 33519148
Take a closer look at your ASP.NET connection string! The value  "Integrated Security=SSPI" says that you're using Windows Authentication, which goes with your statement that you don't have setup a username/password combination.

Thus, I guess, using Integrated Windows Authentication - the second radio button - should work.


mfG
--> stefan <--
0
 

Author Comment

by:goodk
ID: 33519732
An error occurred when creating database: [DataConnection.ExecuteQuery]: Query: CREATE DATABASE [KenticoCMS] COLLATE SQL_Latin1_General_CP1_CI_AS: caused exception: CREATE DATABASE permission denied in database 'master'.
Creating a new database KenticoCMS
 
How do I create a permission?



sqlconnectDB.jpg
0
 
LVL 33

Expert Comment

by:ste5an
ID: 33519904
This is a different question. Close this one,  allot the points. Make it a new one.


mfG
--> stefan <--

p.s.:

Download SSMSE and  create the database with it:

  http://msdn.microsoft.com/en-us/library/ms365247.aspx

For the permission problem see:

  http://msdn.microsoft.com/en-us/library/aa258257%28SQL.80%29.aspx

0
 
LVL 58

Expert Comment

by:cyberkiwi
ID: 33519937
> "Integrated Security=SSPI" says that you're using Windows Authentication

Correct, but this "Windows user" is not you the person running the browser.

http://www.bluevisionsoftware.com/WebSite/TipsAndTricksDetails.aspx?Name=AspNetAccount

It may not have permissions to the database, much less create a new one.
0
 
LVL 33

Accepted Solution

by:
ste5an earned 500 total points
ID: 33520475
> Correct, but this "Windows user" is not you the person running the browser.

You cannot tell this from the problem as described above. The server is running local as you can see from the URL containing localhost. The service may run under any account. In particular, you cannot tell if he is running impersonation or not:

  http://msdn.microsoft.com/en-us/library/aa292118%28VS.71%29.aspx

btw, this is the reason for creating the database manually using SSMSE.


mfg
--> stefan <--
0
 

Author Comment

by:goodk
ID: 33521837
Well, I also have a database which exist and I can connect to it via the string, using asp.net as discussed but I cannot connect to it with the above tool.
error
The database 'SADB' doesn't exist!
 

DBList.jpg
0
 
LVL 33

Expert Comment

by:ste5an
ID: 33521979
Simply right-click on the Databases node and create a new database called 'KenticoCMS'. Then select in your web configuration frontend the second radio button 'Use an existing database' and enter the name. This should do it.

Depending on the permission setup of this CMS you may need to add some permissions to this newly created database. But this should be better answered by the Kentico Software...


mfG
--> stefan <--
0
 

Author Comment

by:goodk
ID: 33523211
so why it is not finding SADB.  I already have that database. See the screenshot please. thanks
0
 

Author Comment

by:goodk
ID: 33530610
stefan, I have followed your instructions but it is still not connecting
Do I have to register the database or do something for it to be visible on the machine???
error message
The database 'KenticoCMS' doesn't exist!
0
 
LVL 33

Expert Comment

by:ste5an
ID: 33531528
So you have created a new database using SSMSE?

Then this sounds more like a wrong setup of ASP.NET and this CMS application. You have to find out which user account is used by the CMS install page and grant full access to this user for you newly created database.

Another possible solution may be: You're running more than one instance of a SQL Server and the CMS install uses such another instance.


mfG
--> stefan <--

0
 
LVL 33

Expert Comment

by:ste5an
ID: 33531568
btw, wer lesen kann ist klar im vorteil.

means: take a look at your screen shot. If the CMS application works in a normal way, then you must grant full access to the NETWORK SERVICE on your database.


mfG
--> stefan <--
0
 

Author Comment

by:goodk
ID: 33536290
I am sorry to ask this,
you mean go to control panel to grant permission to the database?
I am using Vista on a desktop.
0
 
LVL 33

Expert Comment

by:ste5an
ID: 33540545
No, you have to use SSMSE to grant the appropriate persmissions:

 http://technet.microsoft.com/en-us/library/ms178569.aspx


mfG
--> stefan <--
0
 

Author Comment

by:goodk
ID: 33564349
Sorry, it is still did not work. I went and granted all the permissions. Still no luck.
 
Do you want me to send the dump!! thanks
0
 

Author Closing Comment

by:goodk
ID: 34098933
not right, but I learn something.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some very basic things about SQL Server filegroups.
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

831 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