Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Setting password to my own SQL database.

Setting password to my own SQL database.

Scheduled Pinned Locked Moved Database
database
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deepseeindeepsy
    wrote on last edited by
    #1

    Hi, I want to protect my database with ID & Password. How it will be done. :)

    V L J 3 Replies Last reply
    0
    • D deepseeindeepsy

      Hi, I want to protect my database with ID & Password. How it will be done. :)

      V Offline
      V Offline
      Vimalsoft Pty Ltd
      wrote on last edited by
      #2

      Sometimes its difficult to answer questions like this in the Forums , because people don't give us enough information. We have to help them and think what they are trying to achieve. let me tell you what came into my mind when i saw your question. Because if you are having an SQL Database is Hosted into the SQl Server and that Server is Protected by a sa password or you can add more users or restrict other users from accessing your database from the permission of your Database. So you see , you did not give us enough information.

      Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

      D 2 Replies Last reply
      0
      • V Vimalsoft Pty Ltd

        Sometimes its difficult to answer questions like this in the Forums , because people don't give us enough information. We have to help them and think what they are trying to achieve. let me tell you what came into my mind when i saw your question. Because if you are having an SQL Database is Hosted into the SQl Server and that Server is Protected by a sa password or you can add more users or restrict other users from accessing your database from the permission of your Database. So you see , you did not give us enough information.

        Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

        D Offline
        D Offline
        deepseeindeepsy
        wrote on last edited by
        #3

        i dont want my client will access my database in server. now tel me is there any way to avoid this?

        V J 2 Replies Last reply
        0
        • D deepseeindeepsy

          i dont want my client will access my database in server. now tel me is there any way to avoid this?

          V Offline
          V Offline
          Vimalsoft Pty Ltd
          wrote on last edited by
          #4

          Its Simple, Dont give the Password to the Server, if they know it change it

          Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

          1 Reply Last reply
          0
          • D deepseeindeepsy

            Hi, I want to protect my database with ID & Password. How it will be done. :)

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Many Time I am Also Suffer From this Problem but at a long time i find a solution about this problem's. First you Have To Change Window Authentication mode to mix mode authentication. use Done this by Done From Inside SQL Server Object Explore\Properties\Security\Server Authentication Change to mix mode Authentication or by using Query run in Window Authentication mode 1)EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2 2)Alter login sa enable 3)Alter login sa with password ='[abc]' --any Password 4)EXEC sp_revokelogin 'BUILTIN\Administrators' 5)Restart you'r SQL Server Service and Batch File in C#.NEt is int iChar = 34; char aChar = (char)iChar; StreamWriter sStr = new StreamWriter(GetWorkingDir + "//SQLSEREVR.Bat"); sStr.WriteLine("@echo off "); sStr.WriteLine(@"CD\"); sStr.WriteLine(@"osql -E -S .\sqlexpress -Q "+aChar.ToString()+"Alter login sa enable"+aChar.ToString()+""); sStr.WriteLine(@"osql -E -S .\sqlexpress -Q " + aChar.ToString() + "Alter login sa with password ='[abc]'" + aChar.ToString() + ""); sStr.WriteLine("Net stop " + aChar.ToString() + "SQL Server (SQLEXPRESS)" + aChar.ToString() + ""); sStr.WriteLine("Net start " + aChar.ToString() + "SQL Server (SQLEXPRESS)" + aChar.ToString() + ""); sStr.WriteLine(@"osql -E -S .\sqlexpress -Q " + aChar.ToString() + @"EXEC sp_revokelogin 'BUILTIN\Administrators'" + aChar.ToString() + ""); sStr.WriteLine("Net stop " + aChar.ToString() + "SQL Server (SQLEXPRESS)" + aChar.ToString() + ""); sStr.WriteLine("Net start " + aChar.ToString() + "SQL Server (SQLEXPRESS)" + aChar.ToString() + ""); string sBatchFileName = GetWorkingDir + "//SQLSEREVR.Bat";

            1 Reply Last reply
            0
            • D deepseeindeepsy

              Hi, I want to protect my database with ID & Password. How it will be done. :)

              J Offline
              J Offline
              Jerry Hammond
              wrote on last edited by
              #6

              Your DB? Is this DB on a server you do not own/admin? Have you asked the srvadmin?

              "My interest is in the future because I'm going to spend the rest of my life there." - Charles F. Kettering

              1 Reply Last reply
              0
              • D deepseeindeepsy

                i dont want my client will access my database in server. now tel me is there any way to avoid this?

                J Offline
                J Offline
                Jerry Hammond
                wrote on last edited by
                #7

                You're not the dbowner?

                "My interest is in the future because I'm going to spend the rest of my life there." - Charles F. Kettering

                1 Reply Last reply
                0
                • V Vimalsoft Pty Ltd

                  Sometimes its difficult to answer questions like this in the Forums , because people don't give us enough information. We have to help them and think what they are trying to achieve. let me tell you what came into my mind when i saw your question. Because if you are having an SQL Database is Hosted into the SQl Server and that Server is Protected by a sa password or you can add more users or restrict other users from accessing your database from the permission of your Database. So you see , you did not give us enough information.

                  Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

                  D Offline
                  D Offline
                  deepseeindeepsy
                  wrote on last edited by
                  #8

                  Hi, Sir, I m using SQL SERVER 2005 in Windows authentication mode. Anybody on my PC can access the server by using same authentication. That means they can access their own database but they also can access my own too & I don't want to have access to them. I want to secure my particular on ;) ly. I think it is more clesr now. Please help.

                  V 1 Reply Last reply
                  0
                  • D deepseeindeepsy

                    Hi, Sir, I m using SQL SERVER 2005 in Windows authentication mode. Anybody on my PC can access the server by using same authentication. That means they can access their own database but they also can access my own too & I don't want to have access to them. I want to secure my particular on ;) ly. I think it is more clesr now. Please help.

                    V Offline
                    V Offline
                    Vimalsoft Pty Ltd
                    wrote on last edited by
                    #9

                    Now in that case , Change the Authentication and use SQL Authentication. This means you have to give up Windows Authentication and have a spacial credentials for your Database Remove your Windows username from the Permissions of the Database and Add a new username that can only be used by you, then in that case you and only you can access the DB. remember the Windows Authentication does not even ask you for a password as long as you have the correct username the user can enter and that is not advisable in a secure environment. Hope it helps

                    Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups