CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2000
    Location
    Romania, Cluj-Napoca
    Posts
    57

    Setting Ms-access 2k Password

    I need to set programatically a password to a MS-ACCESS 2000 database. How I can do that ?

    Source-code or links to it would be welcomed, especially that I do know COM/DCOM stuff. I believe that somehow the password is set by querying some MSACCESS interface ......

    10x in advance

  2. #2
    Join Date
    Feb 2003
    Posts
    3
    It might not be much help, but using DAO it is:

    CDaoDatabase cdb;
    cdb.Open( "c:\\database.mdb", TRUE, FALSE, "" );
    COleVariant NewPassword( "password", VT_BSTRT );
    COleVariant OldPassword( "", VT_BSTRT );
    DAO_CHECK( cdbNew.m_pDAODatabase->NewPassword( V_BSTR( &OldPassword ), V_BSTR( &NewPassword ) ) );
    cdb.Close();

    Assuming there wasn't a password previously.

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

Featured