SQL Server Authentication issues!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony

    #1

    SQL Server Authentication issues!

    Hi all!

    I am having a rather odd issue with VB.Net (Visual Studio 2005) and SQL
    Server 2005. I developed a little app for our team but then decided to
    make it available for others. Since out team was given admin rights to
    our database, I used integrated security for the first version of the
    app. When I opened it up to other groups, I changed to SQL
    authentication.

    The problem is that no one outside our group has been able to use the
    app because of DB connection issues. It always works from my machine,
    so I checked the activity monitor on the server. Sure enough, I am
    logged in as myself instead of the user I set up for the application.

    Here is the connection string:

    Private m_SQLConStr As String = "Data Source=MYDB;Ini tial
    Catalog=MYDATA; Integrated Security=False; Persist Security
    Info=False;User ID=MYUSER;Passw ord=MYPASSWORD"

    Does anyone have any insight into this problem?

    Thanks!

  • aaron.kempf@gmail.com

    #2
    Re: SQL Server Authentication issues!

    2 choices:

    a) move to mySql; where username/password security is secure. MS SQL
    Authentication is _IMPOSSIBLE_ to secure
    b) enable double-hop authenticaiton for SQL Server; setspn and 'trust
    for delegation'

    -Aaron




    Tony wrote:
    Hi all!
    >
    I am having a rather odd issue with VB.Net (Visual Studio 2005) and SQL
    Server 2005. I developed a little app for our team but then decided to
    make it available for others. Since out team was given admin rights to
    our database, I used integrated security for the first version of the
    app. When I opened it up to other groups, I changed to SQL
    authentication.
    >
    The problem is that no one outside our group has been able to use the
    app because of DB connection issues. It always works from my machine,
    so I checked the activity monitor on the server. Sure enough, I am
    logged in as myself instead of the user I set up for the application.
    >
    Here is the connection string:
    >
    Private m_SQLConStr As String = "Data Source=MYDB;Ini tial
    Catalog=MYDATA; Integrated Security=False; Persist Security
    Info=False;User ID=MYUSER;Passw ord=MYPASSWORD"
    >
    Does anyone have any insight into this problem?
    >
    Thanks!

    Comment

    • Plamen Ratchev

      #3
      Re: SQL Server Authentication issues!

      Hi,

      Can you modify your connection string to look like this and see if it works:

      Private m_SQLConStr As String = "Data Source=MYDB;Ini tial
      Catalog=MYDATA; User Id=MYUSER;Passw ord=MYPASSWORD; "

      You can also try:

      Private m_SQLConStr As String = "Server=MYDB;Da tabase=MYDATA;U ser
      ID=MYUSER;Passw ord=MYPASSWORD; Trusted_Connect ion=False;"

      Regards,

      Plamen Ratchev


      "Tony" <schiefaw@compu ter.orgwrote in message
      news:1166215634 .428796.93090@8 0g2000cwy.googl egroups.com...
      Hi all!
      >
      I am having a rather odd issue with VB.Net (Visual Studio 2005) and SQL
      Server 2005. I developed a little app for our team but then decided to
      make it available for others. Since out team was given admin rights to
      our database, I used integrated security for the first version of the
      app. When I opened it up to other groups, I changed to SQL
      authentication.
      >
      The problem is that no one outside our group has been able to use the
      app because of DB connection issues. It always works from my machine,
      so I checked the activity monitor on the server. Sure enough, I am
      logged in as myself instead of the user I set up for the application.
      >
      Here is the connection string:
      >
      Private m_SQLConStr As String = "Data Source=MYDB;Ini tial
      Catalog=MYDATA; Integrated Security=False; Persist Security
      Info=False;User ID=MYUSER;Passw ord=MYPASSWORD"
      >
      Does anyone have any insight into this problem?
      >
      Thanks!
      >

      Comment

      • Tony

        #4
        Re: SQL Server Authentication issues!

        Hi!

        I have added the trusted source section to the string so it looks like
        the following:

        "Data Source=MYDB;Ini tial Catalog=MYDATA; Integrated
        Security=False; Persist Security Info=False;User
        ID=MYUSER;Passw ord=MYPASSWORD; Trusted_Connect ion=False;"

        It is STILL connecting as my login. This is very irritating. Does
        anyone have any more suggestions?


        Plamen Ratchev wrote:
        Hi,
        >
        Can you modify your connection string to look like this and see if it works:
        >
        Private m_SQLConStr As String = "Data Source=MYDB;Ini tial
        Catalog=MYDATA; User Id=MYUSER;Passw ord=MYPASSWORD; "
        >
        You can also try:
        >
        Private m_SQLConStr As String = "Server=MYDB;Da tabase=MYDATA;U ser
        ID=MYUSER;Passw ord=MYPASSWORD; Trusted_Connect ion=False;"
        >
        Regards,
        >
        Plamen Ratchev

        >
        Thanks,
        Tony

        Comment

        • aaron.kempf@gmail.com

          #5
          Re: SQL Server Authentication issues!

          I dont think that you need the integrated_secu rity = false

          screw this whole thread

          a) make a new text file
          b) rename it to test.udl
          c) double click on it.. setup connection.. hit apply / ok -- however
          you want to do it.
          d) rename it from text.udl to test.txt
          e) open it with notepad and you've got a REAL CONNECTION STRING


          -Aaron




          Tony wrote:
          Hi!
          >
          I have added the trusted source section to the string so it looks like
          the following:
          >
          "Data Source=MYDB;Ini tial Catalog=MYDATA; Integrated
          Security=False; Persist Security Info=False;User
          ID=MYUSER;Passw ord=MYPASSWORD; Trusted_Connect ion=False;"
          >
          It is STILL connecting as my login. This is very irritating. Does
          anyone have any more suggestions?
          >
          >
          Plamen Ratchev wrote:
          Hi,

          Can you modify your connection string to look like this and see if it works:

          Private m_SQLConStr As String = "Data Source=MYDB;Ini tial
          Catalog=MYDATA; User Id=MYUSER;Passw ord=MYPASSWORD; "

          You can also try:

          Private m_SQLConStr As String = "Server=MYDB;Da tabase=MYDATA;U ser
          ID=MYUSER;Passw ord=MYPASSWORD; Trusted_Connect ion=False;"

          Regards,

          Plamen Ratchev
          >
          Thanks,
          Tony

          Comment

          • Plamen Ratchev

            #6
            Re: SQL Server Authentication issues!

            Is it possible that you have defined connection strings on two locations in
            your code and not using the correct one?

            Regards,

            Plamen Ratchev



            "Tony" <schiefaw@compu ter.orgwrote in message
            news:1166478851 .754914.88070@8 0g2000cwy.googl egroups.com...
            Hi!
            >
            I have added the trusted source section to the string so it looks like
            the following:
            >
            "Data Source=MYDB;Ini tial Catalog=MYDATA; Integrated
            Security=False; Persist Security Info=False;User
            ID=MYUSER;Passw ord=MYPASSWORD; Trusted_Connect ion=False;"
            >
            It is STILL connecting as my login. This is very irritating. Does
            anyone have any more suggestions?
            >
            >
            Plamen Ratchev wrote:
            >Hi,
            >>
            >Can you modify your connection string to look like this and see if it
            >works:
            >>
            >Private m_SQLConStr As String = "Data Source=MYDB;Ini tial
            >Catalog=MYDATA ;User Id=MYUSER;Passw ord=MYPASSWORD; "
            >>
            >You can also try:
            >>
            >Private m_SQLConStr As String = "Server=MYDB;Da tabase=MYDATA;U ser
            >ID=MYUSER;Pass word=MYPASSWORD ;Trusted_Connec tion=False;"
            >>
            >Regards,
            >>
            >Plamen Ratchev
            >http://www.SQLStudio.com
            >>
            >
            Thanks,
            Tony
            >

            Comment

            • Tony

              #7
              Re: SQL Server Authentication issues!

              Hey! Neat trick! It didn't directly solve my problem, but it did throw
              an error which helped me diagnose the issue. It seems that the admin
              had only set the database to allow integrated security connections. I
              guess that my attempts to log in as a specific user failed, and the
              system just used a trusted connection instead. I hate it when computers
              try to be helpful.

              Thanks everyone!

              aaron.kempf@gma il.com wrote:
              I dont think that you need the integrated_secu rity = false
              >
              screw this whole thread
              >
              a) make a new text file
              b) rename it to test.udl
              c) double click on it.. setup connection.. hit apply / ok -- however
              you want to do it.
              d) rename it from text.udl to test.txt
              e) open it with notepad and you've got a REAL CONNECTION STRING
              >
              >
              -Aaron
              >
              >
              >
              >
              Tony wrote:
              Hi!

              I have added the trusted source section to the string so it looks like
              the following:

              "Data Source=MYDB;Ini tial Catalog=MYDATA; Integrated
              Security=False; Persist Security Info=False;User
              ID=MYUSER;Passw ord=MYPASSWORD; Trusted_Connect ion=False;"

              It is STILL connecting as my login. This is very irritating. Does
              anyone have any more suggestions?


              Plamen Ratchev wrote:
              Hi,
              >
              Can you modify your connection string to look like this and see if it works:
              >
              Private m_SQLConStr As String = "Data Source=MYDB;Ini tial
              Catalog=MYDATA; User Id=MYUSER;Passw ord=MYPASSWORD; "
              >
              You can also try:
              >
              Private m_SQLConStr As String = "Server=MYDB;Da tabase=MYDATA;U ser
              ID=MYUSER;Passw ord=MYPASSWORD; Trusted_Connect ion=False;"
              >
              Regards,
              >
              Plamen Ratchev

              >
              Thanks,
              Tony

              Comment

              Working...