locked
I need clarification Trusted connection = yes in SQL RRS feed

  • Question

  • User-1573291421 posted

    Hi Friends,

    I created one dll to a software to access data from sql.

    I am accessing sql database using below connection string

    Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;

    My machine having sql server 2008 been installed. When i run my code using above connection string working fine.

    But when i try to run the same code in another machine  Sql Server not been installed I am getting error.

    My question is
    when i use Trusted_Connection=True to access database that machine should have SQL Server Manangment Studio..?


    OR

    When to use Trusted_Connection=True ? I am confused with the credentials

    Thanks

    Monday, January 5, 2015 3:36 AM

Answers

  • User197322208 posted

    when i use Trusted_Connection=True to access database that machine should have SQL Server Manangment Studio..?

    No. The current user (under the site runs) must be authenticated to sql server.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 5, 2015 3:40 AM
  • User753101303 posted

    This is a message you created or does it come from some function? What is "XFNet"?

    It is always easier to start from an actual message/behavior rather than to try to guess. Here it looks like if you have some kind of major problem rather than "just" an authentication problem. For example it look like something such as trying to consume an unmanaged 32 bit DLL from a 64 bit application or the other way round...

    You could try http://msdn.microsoft.com/en-us/library/system.environment.is64bitprocess(v=vs.110).aspx both locally and on this server and see if it returns true or false in both cases...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 5, 2015 2:01 PM

All replies

  • User197322208 posted

    when i use Trusted_Connection=True to access database that machine should have SQL Server Manangment Studio..?

    No. The current user (under the site runs) must be authenticated to sql server.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 5, 2015 3:40 AM
  • User-1573291421 posted

    Hi ignatandrei,

    Thanks !

    Whether i need to give access to database  for the specific user in sql server.? ie., Need to give read access to the database.

    Monday, January 5, 2015 3:59 AM
  • User753101303 posted

    Hi,

    It means that it will run with the current Windows user (in dev mode, it could be your own account, on a real server it would be the account Under which the web app runs). So it could be that it uses an account which is not authorized to access the db etc... (or a firewall issue etc...)

    I am getting error

    Anyway it's best to just tell which error you have (or the closest English translation). It should been then  easier to guide you to solve THIS particular error rather than to have first to guess which error you have.

    Monday, January 5, 2015 4:12 AM
  • User-1573291421 posted

    Hi PatriceSc,

    Actually I have created one dll file to a software, i do not have any option to debug or get exact error.  Any way i metioned the error message which i am getting while that software trying to use my DLL.

    Description:
    Error external function 'TestFunction' returned with errors: XFNet error in estFunction
    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

    i do not have any idea about the issues please assit me.

     

    Monday, January 5, 2015 5:34 AM
  • User753101303 posted

    This is a message you created or does it come from some function? What is "XFNet"?

    It is always easier to start from an actual message/behavior rather than to try to guess. Here it looks like if you have some kind of major problem rather than "just" an authentication problem. For example it look like something such as trying to consume an unmanaged 32 bit DLL from a 64 bit application or the other way round...

    You could try http://msdn.microsoft.com/en-us/library/system.environment.is64bitprocess(v=vs.110).aspx both locally and on this server and see if it returns true or false in both cases...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 5, 2015 2:01 PM
  • User61956409 posted

    Hi cpughalnet,

    Thanks for your post.

    When to use Trusted_Connection=True ? I am confused with the credentials

    As for your problem, you could refer to this similar issue.

    Hope it will helpful for you.

    Best Regards,

    Fei Han

    Monday, January 5, 2015 8:57 PM