June 8, 2004 at 8:37 am
Hi! I was trying to access SQL server from another pc in the Connect to SQL server window. Then a error window appeared saying 'Unable to connect to server DPC (computer name). Server: Msg 18456, Level 16, State 1. [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'DPC/Guest'. How can I fix this error?
How can I access SQL server database from another computer?
In programming it in Microsoft C# .net, how will I write the code to access database from another computer?
Thanks!
June 8, 2004 at 9:01 am
Get your DBA to create you a login on the SQL server and pass that information in your database connection string (sorry don't know C# so I couldn't give you the syntax)
June 9, 2004 at 6:16 am
how do create a login on the SQL Server?
June 9, 2004 at 6:19 am
Is this a server maintained by yourself? Or do you have a dba for general SQL administration?
If you are tasked with creating the login you would need to be at least a Security Admin within SQL to add a login.
June 9, 2004 at 9:21 pm
thanks for the help! i was able to connect the 2 computers already
However, i have another problem. When i was accessing the database from the server an error occured, 'Server user DPC/Guest is not a valid user in database 'SPCProduction' '(a database i created). And when i was checked SPCProduction in the SQL Server Login Properties Database Access, an error also occured, 'The user cannot be mapped to a login name.'
How can i access SPCProduction from the other computer?
June 10, 2004 at 2:37 am
you have to do 2 things:
1- make a login ... this is done from EM under security .. under logins .. then right click .. new login
it is recommended to make SQL Server authentication .. by putting a password for that user
2- then in EM .. go to your DB .. and under user .. right click .. New db user
in login name .. choose the login you write before and click ok
the double click on this user again .. and press permissions .. and put (~/) true sign to the permissions you want to give to that user on your tables, views, Stored procedure , .. etc
I hope this help u
Alamir Mohamed
Alamir_mohamed@yahoo.com
June 10, 2004 at 9:14 am
An easier way is in Enterprise Manager, go to Security>Logins. Double click on the login and on the Database Access tab in the upper window check the box to the left of the database you will access and in the bottom window click on the type of access (ie. datareader).
If you need to grant specific access, then do it the way alamir suggested.
BTW - why is your login GUEST?
-SQLBill
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply