Microsoft SQL Server 2005 (error in connection)

Like my previous blog, I will also posted about technical things in here. Some of the things that I do in my work.

So, I currently building two web-based system for my organization. I'm doing in on the new laptop given by the company to me. As most of you (ASP developers especially), Microsoft SQL Server 2000 is not supported in Windows XP although the architecture of the operating system almost same as Windows 2000. You need another SQL Server for that. The only thing that you can use (can be downloaded for free) is Microsoft SQL Server 2005 Express Edition. Unlike when they newly released the program, now you can download several tools that can be used with the sql server.

After finished installing the program, the first thing I do, is creating a database that is identical like the production database. Problem is, the GUI provided by Microsoft does not support Import/Export data such in Microsoft SQL Server 2000 (its free remember). So, you need to use SQL Server 2000 Manager to connect to the database. I tried to do that but failed. Not sure why. So, the next thing I do, is I copy the whole SQL data and log file for my database into the laptop. Miracle did happpened. And in my case, the database work perfectly.

Happily, I copied the system into the laptop. Then, I tried running the system. Failed. Oh, I forgot to add users in the SQL server. Users created. Running the system again. Failed again. So, you think what really happened? These are the errors that I got in the log file (always remember to log all errors and success connections) :

Error: 18452, Severity: 14, State: 1.
Login failed for user ''. The user is not associated with a trusted SQL Server connection. [CLIENT:]

If you get errors like that, please do this way :
1. Open SQL Server Management Studio Express
2. Right click at the very top of your SQL tree (it has play icon inside a database icon. The name is yourpcname\yoursqlname) and choose Properties.
3. Go to "Security" page. At "Server authentication" choose "SQL Server and Windows Authentication Mode". Click OK.
4. Close all the windows associated with SQL Server.
5. Open "SQL Server Configuration Manager".
6. Go to "SQL Server 2005 Network Configuration"->"Protocols for yourSQLname".
7. Disabled "Shared Memory" and enable TCP/IP protocol. You can also enable "Named Pipes" protocol if you like.
8. After that go to "SQL Server 2005 Services" and restart your SQL Server service. Not "SQL Server Browser" or "SQL Server Reporting Services" or "SQL Server FullText Services".
9. After restarting, run you program again. See if its connected to the SQL server. Its supposed to connect. If not, tell me. :)

I think thats the end for our article. Hope its help you. :)

No comments: