×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

.NET / SQL Server Connection Issue Win 7

.NET / SQL Server Connection Issue Win 7

.NET / SQL Server Connection Issue Win 7

(OP)
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.

RE: .NET / SQL Server Connection Issue Win 7

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.

RE: .NET / SQL Server Connection Issue Win 7

(OP)
Thanks Ralph.

Yes I can ping the SQL Server and other apps can connect to the database.

RE: .NET / SQL Server Connection Issue Win 7

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?

RE: .NET / SQL Server Connection Issue Win 7

(OP)
Using Windows only. Using SQL Authentication is not possible.

I dont know what UAC is I'm afraid.

Sorry to be vague.

RE: .NET / SQL Server Connection Issue Win 7

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

RE: .NET / SQL Server Connection Issue Win 7

(OP)
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.

RE: .NET / SQL Server Connection Issue Win 7

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.

RE: .NET / SQL Server Connection Issue Win 7

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.

RE: .NET / SQL Server Connection Issue Win 7

(OP)
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.

RE: .NET / SQL Server Connection Issue Win 7

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close