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!

Connect to SQL server from windows nt network

Status
Not open for further replies.

mia2007

Technical User
Jun 21, 2007
3
GB
Help!

I'm new to this SQL stuff, I'm writing a small program in vb.net 2005, which connects to a SQL server. The program will only connect to the SQL database if the .exe is located on my c drive. Ideally I would like to run it off a network, so its available to multiply users. but for some reason the program opens but cant connect with the SQL server, I assume its a permissions problem, where my windows username from my computer isnt detected by the SQL server on a network!
If this is the case, how can i tell the server who i am without using sql username/password system
 
mrdenny wrote a VERY GOOD faq's on this topic. I recommend you start here: faq962-5481


-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
What exe? Can you show us your connection string?

sorry, your explanation is a bit confusing. I think we just need more details on what you are trying to accomplish with the program.

Also, can you connect to the instance with enterprise manager or studio management? What version of SQL Server is this

[sub]____________ signature below ______________
You are a amateur developer until you realize all your code sucks.
Jeff Atwood[/sub]
 
The .exe is the program i have wrote in vb .net 2005.
its a program that enters data in to a table with SQL database.
The version of SQL server that i'm using is SQL server 2005.
This server is located on a separate network drive.
I can connect to the SQL server through enterprise manager or my program (if the program file is stored on my hard drive).
But if i was to move the program to a different network drive (i.e H: \Developement) the program cant connect to the database. the program will open but with no data inside.
 
George pointing you to Denny's FAQ was a good idea. I believe he went into using profiler in there. I'm guessing you'll see while running profiler you see this trying to connect
"NT AUTHORITY\ANONYMOUS LOGON"

Or if you try catch your connection (like you should) in the .NET program you'll get that thrown.

Check the FAQ out and see if it helps you find it

[sub]____________ signature below ______________
You are a amateur developer until you realize all your code sucks.
Jeff Atwood[/sub]
 
Windows has built in security features that prevent what applications which are run from network drives can do. Accessing the network is one of the things which is restricted.

You should run the file from a local drive.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
The reason why i'm trying to store my program on a network drive is when the program is updated, it can be easily replaced. where if it was on everyones local drive, it would be a mass exercise to reinstall the program.

is there any code that can be added to my login class, that can identify user name and password authorisation to sql server from the windows active directory?

 
System.Security.Principal.WindowsIdentity

[sub]____________ signature below ______________
You are a amateur developer until you realize all your code sucks.
Jeff Atwood[/sub]
 
Why not write an update procedure into the software which could go and download the updated automatically and lauch the updater on the local machine.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top