Results 1 to 6 of 6

Thread: Password protect a SQL database

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    63

    Password protect a SQL database

    I have almost completed an application using VB Express 2005 that connects to a SQL Express 2005 database. This will be a single user environment. I want to password protect the database so that the application (which will know the password) can connect to it but if somebody copies the database from the application directory and tries to open it themselves, they will need the password to do so. Using VB 2005 I cannot find a way to add the password to the database.

    Once I add the password to the database, do I simply need to modify the connection string with this password so the application can talk to the database without being prompted for a password?

    Thanks.

    Greg

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Password protect a SQL database

    Anyone with ADMIN rights to the PC can copy the mdf/ldf and attach it to another server - you cannot protect the mdf/ldf from a person with these rights - there is no database password in MS SQL.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    63

    Re: Password protect a SQL database

    So in Access where I could simply go to tools, security, set password...the new latest and greatest SQL Server doesn't have password protection? If they took it away, anything easy I can do instead? Again, it's a single computer environment that lots of people will use without any login required for the computer.

    Greg

  4. #4
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Password protect a SQL database

    See if this helps...

    http://forums.microsoft.com/MSDN/Sho...71562&SiteID=1

    and make sure to post back with any solution you find!

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  5. #5
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    396

    Re: Password protect a SQL database

    Hi ghall426;

    This is a quote from Microsoft about this product....

    In addition, like the other members of the SQL Server 2005 product line, SQL Server 2005 Express has the ability to encrypt database data, thereby ensuring that sensitive data can be accessed only by users who have the appropriate permissions. SQL Server 2005 Express supports both symmetric and asymmetric data encryption.

    Some additional research may might allow you to determine if this could be implemented in your situation.

    Hopes this helps.

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Password protect a SQL database

    Quote Originally Posted by ghall426
    So in Access where I could simply go to tools, security, set password...the new latest and greatest SQL Server doesn't have password protection?
    From what I have seen, the security in all versions of SQL Server are far superior to those in Access (I have a 8 line VB program to give you the password for an Access file ).

    While the Admin access to SQL Server is not ideal in all situations, there are ways of blocking it (unfortunately I can't remember them ); on a well-structured network this isn't a problem, but obviously if all users are Admins then it is.

    With Access, anybody who can search the web can get either the source code for free (if they know what to look for, and I'm not telling!), or a pre-written program for a low price.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width