cannot open database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ashlesha pude
    New Member
    • Nov 2009
    • 5

    cannot open database

    i am doin project using vb.net 2005 and using this sql query for connection
    sql = "select username from login order by username"
    con.ConnectionS tring = "Data Source=" & hostname & "; Initial Catalog=college ;integrated security=sspi"
    but m getting the following error:
    Cannot open database "college" requested by the login. The login failed.
    Login failed for user 'CI4\Admin'.
  • MrMancunian
    Recognized Expert Contributor
    • Jul 2008
    • 569

    #2
    Does 'CI4\Admin' have access to your database? And do you realize that in the piece of code you posted, the sql query (sql = "select username from login order by username") isn't executed?

    Steven

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #3
      Originally posted by Ashlesha pude
      i am doin project using vb.net 2005 and using this sql query for connection
      sql = "select username from login order by username"
      con.ConnectionS tring = "Data Source=" & hostname & "; Initial Catalog=college ;integrated security=sspi"
      but m getting the following error:
      Cannot open database "college" requested by the login. The login failed.
      Login failed for user 'CI4\Admin'.
      That's a description of conditions. What is your QUESTION?

      Comment

      • Ashlesha pude
        New Member
        • Nov 2009
        • 5

        #4
        yss (sql = "select username from login order by username") isn't executed.
        CI4 is the newly changed computer name and it cant access database

        Comment

        • MrMancunian
          Recognized Expert Contributor
          • Jul 2008
          • 569

          #5
          Originally posted by Ashlesha pude
          yss (sql = "select username from login order by username") isn't executed.
          CI4 is the newly changed computer name and it cant access database
          So, perhaps that is the reason the login failed?

          Steven

          Comment

          • tlhintoq
            Recognized Expert Specialist
            • Mar 2008
            • 3532

            #6
            Originally posted by Ashlesha pude
            yss (sql = "select username from login order by username") isn't executed.
            CI4 is the newly changed computer name and it cant access database
            please see this thread with same issue

            Comment

            • MrMancunian
              Recognized Expert Contributor
              • Jul 2008
              • 569

              #7
              ROFL, didn't even see that...Well, you've got to give him credit for doing some more explaining :-p

              Steven

              Comment

              • Frinavale
                Recognized Expert Expert
                • Oct 2006
                • 9749

                #8
                Please take a look at the article called How to use a database in your program for an example of how to create an SQL query using parameters.

                -Frinny

                Comment

                Working...