none
OLEDB and SQL passwords

    Question

  • Hi,

    I am trying to produce a quick and dirty app to test database connectivity through filewalls.

    My plan was to write an app that connects to the sql 2000 server and runs a simple select command.

    My first question is when using OLEDB do I have to use integrated authentication or can I use local SQL authentication, via the sa account.

    And secondly If so how? I can't find a property field to set the usename.

     

    Thanks in advance.

    Andy

    Thursday, December 21, 2006 12:06 PM

Answers


  • If you are using the sa account then you will want to use SQL Server authentication. If you use integrated Windows authentication then you would have to create a domain user account for sa. Probably not a real good idea.

    Take a look at connectionstrings.com for the various connection string examples.

    Thursday, December 21, 2006 1:20 PM

All replies


  • If you are using the sa account then you will want to use SQL Server authentication. If you use integrated Windows authentication then you would have to create a domain user account for sa. Probably not a real good idea.

    Take a look at connectionstrings.com for the various connection string examples.

    Thursday, December 21, 2006 1:20 PM
  • What Paul has said is correct, however I would strongly recommend against using the 'sa' account.

    The 'sa' account is the God account for SQL Server and should NOT be used in connection strings for any product whatsoever.  Why?  Because if your code falls into the wrong hands without your knowledge, you have just given away the most powerful credential on your sever.

    If you want to use SQL Server Authentication, please create a separate account to do your testing and give it the appropriate permissions.  This will only take you a few seconds but could save you hours of restoration time, or even your job, if someone hacks into your servers.

     

    Thursday, December 21, 2006 9:22 PM