C# and SQL Part 2: Attack of the "Login Failed For (thiscomputer)/Guest"!
-
Hi all, First of all, thanks to everybody who offered much needed advice for getting the server set up on my home machine. My program can interface with the server and do some basic operations, which is exactly what was needed. Second, sorry if this is considered a repost--I posted earlier today about this but didn't get a response. Didn't know if CP sends notifications to everybody in the thread if anything at all is added to the thread, hence why I'm posting here. My question is pretty simple. I'm trying to log onto the server with a laptop using a username/password combo. What I end up with is, "Login failed for user (this computer)/Guest", where "this computer" is the computer hosting the server. I've read articles about how to fix this, and most focus on creating a login the server knows about, and using Mixed mode for remote access. But everything I've tried results in that same error message. How do I make this work? Server machine is WinXP Pro, remote machine is Vista. Thanks for any advice, Michael Fritzius P.S. Actually the next part after this will be to log into the server via the internet, using an IP address. Any tips on that would be appreciated too, so I don't have to make yet another post :)
-
Hi all, First of all, thanks to everybody who offered much needed advice for getting the server set up on my home machine. My program can interface with the server and do some basic operations, which is exactly what was needed. Second, sorry if this is considered a repost--I posted earlier today about this but didn't get a response. Didn't know if CP sends notifications to everybody in the thread if anything at all is added to the thread, hence why I'm posting here. My question is pretty simple. I'm trying to log onto the server with a laptop using a username/password combo. What I end up with is, "Login failed for user (this computer)/Guest", where "this computer" is the computer hosting the server. I've read articles about how to fix this, and most focus on creating a login the server knows about, and using Mixed mode for remote access. But everything I've tried results in that same error message. How do I make this work? Server machine is WinXP Pro, remote machine is Vista. Thanks for any advice, Michael Fritzius P.S. Actually the next part after this will be to log into the server via the internet, using an IP address. Any tips on that would be appreciated too, so I don't have to make yet another post :)
Michael Fritzius wrote:
I posted earlier today about this but didn't get a response. Didn't know if CP sends notifications to everybody in the thread if anything at all is added to the thread, hence why I'm posting here.
If you post a reply to yourself, the others who have replied won't get a notice, but if you reply to someone elses post, he/she will get an email. To your question. If you want to use SQL Server authentication, you must create a login for yourself (or use an existing one). When you installed the SQL Server instance you were prompted if you want to use Mixed mode authentication. If you selected it, the installation prompted for the password for user SA. You can use that login to connect to the SQL Server. SA is like Administrator in Windows. It has all the privileges in SQL Server. After logging into the SQL Server, you can create additional logins and grant rights to them. The easiest way to create a login is to use Management Studio. Select from the Object explorer Security/Logins, right click and select New Login. This opens a dialog where you can specify what kind of login you want to create and then grant privileges to the login. Addition:
Michael Fritzius wrote:
the next part after this will be to log into the server via the internet, using an IP address
Basically this is exactly the same as you would connect to your local server. You can define server as ip-address and port, like: 127.0.0.1,1433. You just need to check the port SQL Server is listening using for example Configuration Manager and make sure that you have secure connection over the internet so that the port can be opened for you.
The need to optimize rises from a bad design.My articles[^]
modified on Monday, January 26, 2009 5:53 PM
-
Michael Fritzius wrote:
I posted earlier today about this but didn't get a response. Didn't know if CP sends notifications to everybody in the thread if anything at all is added to the thread, hence why I'm posting here.
If you post a reply to yourself, the others who have replied won't get a notice, but if you reply to someone elses post, he/she will get an email. To your question. If you want to use SQL Server authentication, you must create a login for yourself (or use an existing one). When you installed the SQL Server instance you were prompted if you want to use Mixed mode authentication. If you selected it, the installation prompted for the password for user SA. You can use that login to connect to the SQL Server. SA is like Administrator in Windows. It has all the privileges in SQL Server. After logging into the SQL Server, you can create additional logins and grant rights to them. The easiest way to create a login is to use Management Studio. Select from the Object explorer Security/Logins, right click and select New Login. This opens a dialog where you can specify what kind of login you want to create and then grant privileges to the login. Addition:
Michael Fritzius wrote:
the next part after this will be to log into the server via the internet, using an IP address
Basically this is exactly the same as you would connect to your local server. You can define server as ip-address and port, like: 127.0.0.1,1433. You just need to check the port SQL Server is listening using for example Configuration Manager and make sure that you have secure connection over the internet so that the port can be opened for you.
The need to optimize rises from a bad design.My articles[^]
modified on Monday, January 26, 2009 5:53 PM
Mika, Thanks for the advice. I didn't know it, but no permissions were set up AT ALL for that user. I knew something was weird at the server side, but couldn't figure it out. The laptop can now talk with the server, and retrieve info. I'll work on table manipulation next. Unfortunately, I can't test to see if IP login will work because it's a small network here. So I may be posting for you again soon. Thanks again, Michael Fritzius
-
Mika, Thanks for the advice. I didn't know it, but no permissions were set up AT ALL for that user. I knew something was weird at the server side, but couldn't figure it out. The laptop can now talk with the server, and retrieve info. I'll work on table manipulation next. Unfortunately, I can't test to see if IP login will work because it's a small network here. So I may be posting for you again soon. Thanks again, Michael Fritzius
Michael Fritzius wrote:
no permissions were set up AT ALL for that user
Could it be that you haven't chosen Mixed mode during the setup.
Michael Fritzius wrote:
Thanks again
You're welcome
The need to optimize rises from a bad design.My articles[^]
-
Michael Fritzius wrote:
no permissions were set up AT ALL for that user
Could it be that you haven't chosen Mixed mode during the setup.
Michael Fritzius wrote:
Thanks again
You're welcome
The need to optimize rises from a bad design.My articles[^]
It was working and I wasn't getting that error mentioned in the subject. Today I was testing it and logging on from a networked machine doesn't work anymore. I don't remember changing any of the connection strings--my goal was to work with data entry and leave connection strings alone once they were established as working properly. Is there any reason why this would have worked before and not now? Thanks, Michael Fritzius
-
It was working and I wasn't getting that error mentioned in the subject. Today I was testing it and logging on from a networked machine doesn't work anymore. I don't remember changing any of the connection strings--my goal was to work with data entry and leave connection strings alone once they were established as working properly. Is there any reason why this would have worked before and not now? Thanks, Michael Fritzius
If you haven't changed the connection string the most likely reason is that something has changed in Active Directory (if you use integrated security) or in the database privileges. Open the management studio and check the login you use. Does it still have the privilege to use the database you're interested in (is there a checkbox before your database in the user mapping page)?
The need to optimize rises from a bad design.My articles[^]
-
If you haven't changed the connection string the most likely reason is that something has changed in Active Directory (if you use integrated security) or in the database privileges. Open the management studio and check the login you use. Does it still have the privilege to use the database you're interested in (is there a checkbox before your database in the user mapping page)?
The need to optimize rises from a bad design.My articles[^]
The proper checkboxes were there, yes. But for whatever reason it now works and I don't think I changed anything. No idea what caused it to not work before. But, you were a huge help before and it's likely I did something you suggested without realizing it. So I'll give you credit anyway ;P