Connection String and guest user: server doesn´t recognize me!

  • Hi folks!

    I'm trying to connect to a SQL Server 2008 Express Edition with authentication in mix mode (login or windows authentication mode).

    When I'm in server and use SQL Server Management Studio (SSMS) I'm able to connect with Windows Authentication and with a specific login.

    I did a program that connects to this server but I always receive a error that the guest account wasn´t found.

    I created a login and a user for my program that is called SGDA. I'm using this connection string:

    Provider=SQLNCLI10.1;Integrated Security="";Persist Security Info=False;User ID=SGDA;Pwd=myPass;Initial Catalog=SGDA20;Data Source=SERVER\SGDA20;Initial File Name="";Server SPN=""

    I always receive the error: "Login failed for user SERVER\guest".

    Why does the server always connect me as a guest? I'm using SGDA id and my personal password. Is there anything wrong on my connection string?

  • I found this connection string:

    Driver={SQL Server Native Client 10.0};Server=SERVER\INSTANCE;Database=MY_DB;Uid=MY_ID;Pwd=MY_PWD;

    It solved my problem but I still don´t know why the previous connection string didn´t work. Any idea?

  • It's probably getting confused as to what to connect you as because you put Integrated Security="";. As far as I'm aware Integrated Security should = True or SSPI or removed from the Connection String completely. It certainly isn't necessary if you're using a SQL login anyway!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply