Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Can't access SQL database across network

Author  Topic 

parrot
Posting Yak Master

132 Posts

Posted - 2008-12-03 : 17:08:55
I am attempting to access an SQL database from a network drive. I attempted to run the application on my main computer from my laptop but I get an error saying "Login failed for user. The user is not associated with a trusted SQL Server connection". I assume that I have to add new logins in the Security section using Microsoft SQL Server Management Studio but it doesn't show any logins from outside the main computer on which the sql database resides. So how do I add a user login from a networked drive so that they can access the SQL database from their computer?
Dave

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-03 : 17:15:00
You have to decide whether or not you want to use SQL or Windows authentication. If you choose SQL authentication, then add a SQL account with userid/password. If you choose Windows authentication, then add the domain account of the person who is logged into the client machine. Make sure to provide appropriate permissions to whichever account you add.

Also, if you choose SQL authentication, then you need to make sure you are configured to use mixed-mode authentication on the SQL Server. The default is Windows only.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

parrot
Posting Yak Master

132 Posts

Posted - 2008-12-04 : 10:18:26
Thanks for your reply. I wish to use Windows authentication. When I try to add a new login in Enterprise Manager it only shows available login names from my local computer. None show for the other computers in the network. In the network my local computer is Vista while my networked computer is HP. All I see is logins for Vista\??? and nothing for HP. So how do I find the domain account for the person who wants to access the database from a networked computer?
Dave
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-04 : 10:20:53
quote:
Originally posted by parrot

Thanks for your reply. I wish to use Windows authentication. When I try to add a new login in Enterprise Manager it only shows available login names from my local computer. None show for the other computers in the network. In the network my local computer is Vista while my networked computer is HP. All I see is logins for Vista\??? and nothing for HP. So how do I find the domain account for the person who wants to access the database from a networked computer?
Dave


is your machine in the domain?
Go to Top of Page

parrot
Posting Yak Master

132 Posts

Posted - 2008-12-04 : 11:09:29
Yes;
Under the Network in Windows Explorer is HP and Vista. Vista contains the database and HP is the computer from which I want to access the database. I guess I get confused as to what a domain refers to. I thought it referred to computer names in a network. Is that correct?
Go to Top of Page

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2008-12-04 : 11:41:11
Even if you can not browse domain users, you can still add them as users in format:
DOMAIN\USER
If the server is accessible by the network users they will still be authenticated.
Go to Top of Page

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2008-12-04 : 11:50:50
In Explorer: right click on "My network places" - choose explore. Opens "Entire Network", inside is: "Microsoft Windows Network". Inside this is the domain or domains. Inside this upper level are the PC's / servers /printers etc. The upper level name is the domain name.
You can check if the machine is on a domain: Control Panel, Network connections, Advanced , Network Identification - it will either say Workgroup or the domain name
Go to Top of Page

parrot
Posting Yak Master

132 Posts

Posted - 2008-12-04 : 12:49:12
I have a group name under Windows Network called DTRON. Underneath that are my computers Vista and HP. I try to add the following user login on the Vista side where the database is located - DTRON\HP\Guest. I receive an error stating that the login cannot be found. Is my syntax incorrect? Is there an option specifying whether the server is accessible by other network users?
Go to Top of Page

parrot
Posting Yak Master

132 Posts

Posted - 2008-12-04 : 13:13:35
The connection properties for the database specifies Windows Authentication and the User Name is 'Vista\Dave'.
I use the following connection string:

string strConn = "Provider=SQLOLEDB; Data Source=" + sqlserver + "; Initial Catalog=" + Filename.SelectedItem.ToString() + "; User ID=Vista\\Dave; Password=";

and get an error stating "Login failed for user 'Vista\Dave'". What can be wrong here?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-04 : 13:31:52
I would go with SQL authentication as it doesn't sound like you are on a domain, but rather you are using workgroups.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

parrot
Posting Yak Master

132 Posts

Posted - 2008-12-04 : 13:45:22
Yes, I am using workgroups. How can I add an sql authentication or account to my server in Enterprise Manager? I tried to edit the Registered SQL Server Properites by clicking on Use SQL Server authentication and then entering a Login Name and password. It gave me an error stating "SQL Server registration failed because of the connection failure, "Login failed for user DTRON". Do I need to use an existing login and if so where do I find it?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-04 : 13:50:04
Go to the logins section in Enterprise Manager and add an account there.

By the way, your connection string above is attempting to use SQL authentication even though you are providing a Windows account. You need to know the difference in the connection strings, visit www.connectstrings.com to learn more.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

parrot
Posting Yak Master

132 Posts

Posted - 2008-12-04 : 16:01:28
I realize now that I was attempting to use a Windows validation instead of an SQL validation. I added a new login for my database with the user name of DTRON and a password and it does access the database but it now led me into another problem. With the new version using SQL authentication I get only one table from the command "SELECT TABLE_NAME, TABLE_TYPE FROM INFORMATION_SCHEMA.TABLES". When I used Windows authentication, this command would return 24 tables, now only 1. Here I thought everything was working and now this. I am completely stumped. Any suggestions.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-04 : 16:11:24
You probably aren't looking at the right database.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

parrot
Posting Yak Master

132 Posts

Posted - 2008-12-04 : 16:28:35
False alarm, I just realized that I failed to map my new login id to the proper data base. So now it appears to be working. I want to thank everyone who contributed to this topic. Your help is certainly appreciated in leading me through the dark paths of SQL security.
Go to Top of Page
   

- Advertisement -