Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.NET / SQL Server Connection Issue Win 7

Status
Not open for further replies.

Aidy680

Technical User
Nov 1, 2006
138
GB
Hi,

I have a .Net app, written in VS2008 that connects to a SQL 2005 back end, on Win 7.

Everything works fine on XP.

However, on Win 7, unless the user is in an Admin AD Group, the connection fails with the error message:

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)

I've read through countless other posts that suggest checking that TCP/IP etc is enabled, which it is, and if it wasn't then why would the user connect OK when he is put into an AD Group with more permissions?!

Anyone got any ideas?

Apologies if this is the wrong forum.
 
Can you connect from that same win 7 machine to that same db with other applications, like Sql Server Management Studio? Take you application out of play.
 
Thanks Ralph.

Yes I can ping the SQL Server and other apps can connect to the database.
 
are you using SQL Server Authentication or Windows Security only? I know you said you can connect with AD Admin's but are you trying sql authentication also? I wonder if there is an issue with UAC. Can you run this application as administrator and see if that has any impact?
 
Using Windows only. Using SQL Authentication is not possible.

I dont know what UAC is I'm afraid.

Sorry to be vague.
 
UAC is user access control. Its new in Vista. when the UCA level (Set in control panel\users\user access control) is set high, allot of things will not work as expected. But if you run the application as administrator (right click on applications icon and select "run as administrator") you may find things start to work.

If you are finding your troubles while debugging in VS, then you will want to start VS as administrator.

Ralph
 
I appreciate your help Ralph, but I cant run it as an Admin as I have no idea what the password is and getting it, is not an option.

It must be the app as they can see SQL Server otherwise.

I'm wondering if they're connecting to DEV somehow, as everything seems to be pointing in that direction.
 
if you are a local admin, then you should not need the admin password, but if you clicked "run as admin" and you are asked for the PW, then you may not be local admin.

It may be worth asking an admin to enter his credentials just to get it out.
 
If you are using DSN, have you verified DSN names? Remember 64-bit applications will not access 32-bit DSN's and vice-versa, and there is two different spots to put them in.
 
Thanks for your reply Borvik.

I'm not using a DSN - I'm using a hard-coded connection string within the app itself.

Hope this makes sense.
 
Maybe you can post some code to help us understand your connection.

Also, what platform are you compiling to (any, x86 or x64)?

Thanks,
Ralph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top