DB connection error

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
15 years ago
Hi

I have a newbee question, that I couldn't solve through internet help:

When opening the webpage, using a local host as sql server, I got an unexpected error on connecting to the sql database... SQL server does not allow remote connections (the error message from IE was in danish so I thought it would do no good reposting it here)... I tried testing the connection to the database directly from the MS visual web developer 2008, but got the following error message in english:

"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)"

This is what I've done:
1) In the SQL Server configuration manager I've enabled Named Pipes and TCP/IP under the protocols for my sqlexpress instance.
2) I've loaded the databases and the database data provided by nopcommerce into my SMSS 2008 instance...
3) Enabled Vista firewall access to SMMS, the SQLexpress instance and visual web developer.

Im running:
Vista
Visual Web developer 2008
IE7
SMSS 2008
SQLexpress 2008 (localhost)

Im kinda running out of ideas, and a little help would be apriciated..

Thanks in advance
/Peter
15 years ago
A few questions.

Can you see the database in the management studio?
Did you restart your SQL Server after enabling named pipes?
Can you create an odbc connection using the normal odbc administrator (start > run > odbcad32.exe)?

Thanks,
Ben
15 years ago
1) The database is visual in the SSMS under the database folder. First there is an entry called "System Databases" then below is one called "nopcommerce".
2) I restarted the entire machine.
3) When running the odbcad32.exe the ODBC-data source administrator opens. How do i create and test a odbc connection from here? Do I need to allow this program firewall access, or is it enough that the sqlservr task has firewall access? There is a tab called "user-dns" and I tried adding a new "user data source", selected "SQL server", and then entered the options for my sql instance. When selecting the sql instance, the "myuser-pc" instance that I have configured in sqlexpress appears. When trying to connect to the instance I get the following error message:

Could not create connection:
SQLstate: 01000
SQL-server error: 2
Could not create connection:
SQLstate: 08001
SQL-server error: 17

The error was in danish so the translation might be wrong...
What am I doing wrong here? Must be something really simple, like a wrong setup in the sql instance??

Thanks in advance
/Peter
15 years ago
1) Open odbcad32.exe
2) Select the User DSN tab
3) Click Add
4) Select the Sql Server Driver
5) Give your connection a name and description (can be anything)
6) Type in the name of the server (e.g. localhost\SQLEXPRESS - in your case) or just click the drop down to use the SQL Server Browser
7) Click next and then choose your authentication mode. You need to use "SQL Server Authentication" but this does rely on your SQL Server supporting Mixed Mode Authentication (something you would have specified in the sql server setup)
8) With SQL Server auth selected, enter your database username and password (this will be the login you created for the database)
9) Click Next, next, finish and then test.

If you installed SQL Server as part of the VWDE setup then Mixed Mode authentication should be enabled. You can check though by opening up SSMSE and right clicking your server and choose properties.

If your purpose is to just test / develop the site then why not just move the db to the App_Data directory and attach there (since you are doing it all locally).

Also, not sure whether nopcommerce is fully supported/tested on SQL Server 2008??

Thanks,
Ben
15 years ago
concerning SQL Server 2008:

Not too many things have changed with SQL 2008 (at least concerning the stuff that nopCommerce uses), so it is safe to use with SQL 2008. If you are really (over-)concerned that your shop system will not run 100% safe, than there is a 2005 compatibility mode you can configure in MSSQL 2008.

Hope I could help.

Cheers,
hoppi
15 years ago
I was able to find a solution to the above problem. Just for furture references I will post it here:

I downloaded the 1.10 version of nopcommerce and ran the installion guide. The same result as before.

It turned out that the SQL Server Agent and Browser wasn't started. I couldn't start the tasks from the SQL server configuration studio for some reason. Then I opened the program "Services.msc" via run. Here I found both task and clicked properties. Then as starttype I selected "Automatic". On the "Log On" tab I selected "local system account" as the prefered logon type. After this I was able to start both services.

Then I tried with the installation guide from nopcommerce again and I was able to connect to the database without any problems. Now it works perfect.

Thanks for all the inputs and I hope someone else can use this.
/Peter
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.