本人想用DAO访问加了密的ACCESS数据库.请问各老手:
在DAO中哪一项是有关对数据源密码设置的.
如有代码更加感谢!

解决方案 »

  1.   

    virtual void Open(
       LPCTSTR lpszName,
       BOOL bExclusive = FALSE,
       BOOL bReadOnly = FALSE,
       LPCTSTR lpszConnect = _T(
       "" )
    );If you are opening a Microsoft Jet (.MDB) database, use the lpszName parameter and pass an empty string for the lpszConnect parameter or pass a password string of the form ";PWD=password" if the database is password-protected (.MDB databases only). 
    If you are opening an ODBC data source, pass a valid ODBC connection string in lpszConnect and an empty string in lpszName. 
      

  2.   

    CDaodatabase dao;
    dao.Open(.....,";PWD=password")