Site Search:
Sign in | Join | Help

Login failed error

Last post 07-08-2008 4:22 AM by Alwani. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 03-05-2008 9:55 AM

    Login failed error

    Hi,
    In our office environment, we installed the GP database server in another server (Ex: ServerName: PCNUM1\SQL2005). And they installed Econnect in my Desktop. I am able to connect to that SQL server using SQL server credentials (In econnect 10--> Requester setup & Microsoft Sql server management studio express). But I am not able to connect using "Windows Authentication".

     

    In this scenario, How can i use the EConnect to get/insert value into GP server.?  Because, I am getting "Login failed for user ''. The user is not associated with a trusted SQL Server connection." error, while running the source code.

     

    for more info, please see my code below:

    Dim strConnect As String = "data source=PCNUM1\SQL2005; initial catalog=TWO; integrated security=SSPI; persist security info=False; packet size=4096"

    Dim eConnResult As Boolean

     

    'Instantiate an eConnectMethods object

    Dim eConnObject As New eConnectMethods

    Dim xDoc As New XmlDocument

    Dim xmlStr As String

    xmlStr = "<eConnect>"

    xmlStr = xmlStr & "<RMCustomerMasterType>"

    xmlStr = xmlStr & "<taUpdateCreateCustomerRcd>"

    xmlStr = xmlStr & "<CUSTNMBR>MYCUSTNUMBER</CUSTNMBR><!-- (REQUIRED) string(15) Customer number-->"

    xmlStr = xmlStr & "<CUSTNAME>MYCUSTNAME</CUSTNAME>"

    xmlStr = xmlStr & "</taUpdateCreateCustomerRcd>"

    xmlStr = xmlStr & "</RMCustomerMasterType>"

    xmlStr = xmlStr & "</eConnect>"

    xDoc.LoadXml(xmlStr)

    Try

     

    'If the update returned TRUE, it was successfully completed

    eConnResult = eConnObject.eConnect_EntryPoint(strConnect, EnumTypes.ConnectionStringType.SqlClient, xDoc.OuterXml, EnumTypes.SchemaValidationType.None)

    Catch ex As eConnectException

    Throw New Exception(ex.Message)

    Catch ex As System.Data.SqlClient.SqlException

    Dim myError As System.Data.SqlClient.SqlError

    Dim strMsg As String = ""

    For Each myError In ex.Errors

    strMsg += myError.Message + vbCrLf

    Next

    Throw New Exception(strMsg)

    Catch ex As Exception

    Throw New Exception(ex.Message)

    End Try

     

    • 202.54.171.195
  • 03-05-2008 12:32 PM In reply to

    Re: Login failed error

    I've got a couple of ideas. First, understand that eConnect talks to the SQL Server via the eConnect service.

    Next, understand that if you code is not running on the server, you have to get DCOM up and running. I loathe settin up DCOM so much that I won't support that method. What I do is ALWAYS build a web service that sits on the SQL Server, my VB apps submit text eConnect docs to the SQL Server. That way, I never have to mess with DCOM <shudders>

    So, for our purposes here, make sure that whatever code you are talking about is running ON the SQL server. If it's not, I don't support that. <smiles>

    Next, get the username and password that the eConnect service is running under. It should be a domain account (but it doesn't have to be). Look in SQL Server security, make sure that use has rights to the database in question and is a member of the DYNGRP role for that database.

    That's usually what causes that error.

    Steve Gray, MCDBA
    Technical Editor
    steve@VSToolsForum.com
    • 216.77.101.2
  • 03-05-2008 12:43 PM In reply to

    Re: Login failed error

    Thanks steve for ur response. Actually i am very new to Econnect.. :) So Is there any material to connect GP web services from dot net windows application?

    And, In my development environment, I am sure that DCOM+ services are UP and running. Is there any other way to fix this?

    • 202.54.171.195
  • 03-05-2008 1:14 PM In reply to

    Re: Login failed error

    I haven't used GP web services yet, I create my own web service and place it on the server. Are you comfortable with creating a web service?

    Calling it from VB is not too hard, if you've coded that sort of thing before. Let me know if you need help.

    The DCOM thing does work, but I don't support it. I've had some major crash-and-burns at customer locations, and spent days trying to figure it out. My 'web service only' approach work 100% of the time.

    At any rate, have you looked at the user that the eConnect Service is running under? Does it have rights to SQL Server? Is the service started?

    Steve Gray, MCDBA
    Technical Editor
    steve@VSToolsForum.com
    • 216.77.101.2
  • 03-19-2008 9:25 AM In reply to

    Re: Login failed error

    Still i am trying to rectify this login failed issue.

    I am getting the below error still, when i debug the application.

    Login failed for user ''. The user is not associated with a trusted SQL Server connection.

    Does anyone know, why this kind of error occuring?

    • 202.54.171.195
  • 07-08-2008 4:22 AM In reply to

    Re: Login failed error

    Dear Steve,

    I have asked you this before also, and again a request do you mind to share your own web service develop. I do not have enough expereince how to make web service or use it and if you think that you can share this with us. it will really value for us. alwani89@hotmail.com

    MCSD,
    Certified Microsoft Retail Specialist
    Certified Microsoft Great Plains Specialist
    Certified Cognos BI Specialist
    • 88.84.104.102
Page 1 of 1 (6 items)