Login Failed: The login is from untrusted domain and cannot be used with windows authentication RRS feed

  • Question

  • i was testing sql by connecting two pcs,

    PC(A): sql server 2008 on windows 7

    PC(B): other one i built vb project.

    on my main form vb project is able to insert, delete or update everything including file insert into sql as binary, both pcs can do all operation except PC(B) the path use to download file from binary didn't work, it still pop up msgbox("the login from untrusted domain.....) while PC(A) can use all function.

    how is this problem happen, please help me for this project?

    Thursday, October 4, 2018 2:26 AM

All replies

  • Can your PC(B) machine uses SQL Server Authentication (username + password) to connect to the SQL Server instance in PC(A)? You need to create a corresponding SQL Server Login in the sql server and an Database User in the database mapping to that sql server login.
    Thursday, October 4, 2018 3:41 AM
  • Hello,

    I guess you have a simple Windows Workgroup and not a Window Domain in your Network? Windows Authentication don't work in a Workgroup, only in a Domain; you have to use SQL Authentication instead: Authentication in SQL Server

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    • Proposed as answer by Puzzle_Chen Thursday, October 4, 2018 9:30 AM
    Thursday, October 4, 2018 5:50 AM
  • Hi BongTang,

    According to your description, my understanding is that your login failed due to the login is from untrusted domain and cannot be used with windows authentication. If anything is misunderstood, please tell me.

    In order to use Windows Authentication, you should have an Active Directory environment and the user has rights to connect to that database. You can establish a Windows Domain Controller and then connect all of the relevant machines to that controller. If all the pcs are in the same Windows Domain, you can fix SQL server to use domain accounts.

    Just like Olaf said, you can change SQL server to use both Windows and SQL Server accounts.  Right-click the instance in SSMS and choose Properties. You will see the server authentication in Security.

    Then create SQL Server logins to connect to SQL Server on PC(A). You can create it by using SSMS or T-sql script.

    Best Regards
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Edited by Puzzle_Chen Thursday, October 4, 2018 9:29 AM
    Thursday, October 4, 2018 9:26 AM