Showing posts with label applications. Show all posts
Showing posts with label applications. Show all posts

Friday, February 24, 2012

Can''t Connect to SQl via Windows NT Network

Help!

I'm writing some VB.net 2005 windows applications which connect to various tables within SQL Server 2005.

If my programs are running from C drive, I have no problems connecting to my database.

but if i run my exe file from a network drive, then the SQL server doesnt recognise the user's pc, and wont allow my program to access any data.

Can anyone help me with this problem?

What is the exact error message you came across?

Can you answer the question according to the following guidance?

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=362498&SiteID=1

Good Luck!

Ming.

|||I guess you are receiving exception due to security restrictions, right ? This is caused by the CAS defined for network locations making it not possible to use all applications / assemblies from network ressources.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

The problem was solved by adding a strong name when publishing the program.

Thursday, February 16, 2012

Cant connect to SQL 2005 Express with SQL Server Management Studio Express

I've seen the following error posted when people try to connect to their server via their applications but didn't see anyone having problems when trying to connect with SQL Server Management Studio Express. Am I missing something here? This is the error:

<<
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)(Microsoft SQL Server, Error: 2)
>
The server is not remote so I don't see why I need to enable remote connection. I am also using the default connection settings.

Are U using 'Windows Authentication' or SQL Server Auth?

While trying to login as 'sa' on my SQLServ2005 Express, I'm getting a bunch of errors like...

Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)

No idea why !!!

I thought 'sa' was the ultimate super-user login. If 'sa' is not a trusted connection, then who is... sounds like a big joke !!

|||

I figured out the solution to my problem. By default, the Server Managaement Studio tried to connect to my computer name. It turns out when you install SQL 2000 Express, the default instance name is SQLEXPRESS. So when connecting, I just changed the server name to <computer name>\SQLEXPRESS and it worked!

As to your problem BugSlayer, I have seen that error before. It was due to the fact that the server was configured to allow only windows authentication. It has to be set to "mixed authentication" or "both windows and sql authentication" (I forget what the exact words were). I tried to look for the setting but couldn't find it. I set mine explicitly during installation. Hope that helps.

|||

Thanks NthPixel.

Actually my installation of SQL 2005 Express was an accident waiting to happen. I had installed on top of an existing MSDE (from VS 7.0) and for reasons unknown the 'sa' account was locked out PLUS built-in/Administrators did not have any grant rights. A classic catch-22 situation !!

Had to uninstall both SQLExpr & MSDE and reinstall SQLExpr with mixed auth mode this time, and now I'm able to use both types of authentications. Although our symptons match, the problem on my machine basically arised from upgrading MSDE to SQLServer 2005 Express.

If any of U have such a setup, please remove and simplify it before it blows up in to a massive disaster at some future critical juncture.