CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 1999
    Posts
    18

    How to visit Dao which has a password?

    I want to visit a Dao access,which has a password
    and I know the password.How to write the open
    dao code?


  2. #2
    Join Date
    May 1999
    Posts
    40

    Re: How to visit Dao which has a password?

    You can specify Your password while creating CDaoWorkspace object (use pWorkspace->Create ("MyWorkspace", "MyName", "MyPassword")). Then, You should use this opened workspace when you create the CDaoDatabase object (Use constructor of CDaoDatabase: CDaoDatabase (pWorkspace)).


  3. #3
    Join Date
    Mar 1999
    Posts
    18

    Re: How to visit Dao which has a password?

    Thank you very much!


  4. #4
    Join Date
    Apr 1999
    Location
    Melbourne, VIC
    Posts
    72

    Re: How to visit Dao which has a password?

    Or, if you don't need to create the db you don't even need a workspace object, just whack the connect string into the Open call.
    e.g.
    CString m_strPwd = ";pwd=BUTSO";
    CDaoRecordset rs;
    try
    {
    rs.Open("DBName" /* DAO will append .mdb */, TRUE /* Share Exclusive */, FALSE /* Read Only */, (LPCTSTR)m_strPwd /* Connect String */);
    }
    catch (CDaoException * e)
    {
    TRACE("Error: %s\r\n", e->m_pErrorInfo->m_strDescription);
    }






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