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

    CDaoDatabase.Open()

    Hi,
    Can anyone tell me why I am getting an error message from the DAO sub-system telling me that it can't find an Installable ISAM when I try to access an Access database that I have just created under program control?

    I am able to create the database using the pgm code below, but when I try to open it if it already exists, it tells me that it can'f find an Installable ISAM.

    Help, anyone!


    Thanks,

    Austin.

    -------------------------------------------------
    bool CExtractDlg::GetAccessDatabase(void)
    {
    CDaoDatabase dDAO;
    int nResult;
    struct _stat buf;
    bool retVal = true;

    if ((nResult = _stat(m_OutputFPath, &buf)) != 0)
    {
    msgString.Format("New Access database file <%s> will be created.\n\nContinue with process?", m_OutputFPath);
    if (!dispMsg("New Database!", msgString, 4))
    retVal = false;

    if (retVal)
    dDAO.Create(LPCTSTR(m_OutputFPath), dbLangGeneral, 0);
    }
    else
    dDAO.Open(LPCTSTR(m_OutputFPath), true, false, _T(""));

    dDAO.Close();

    return retVal;

    }


  2. #2
    Join Date
    Apr 1999
    Posts
    38

    Re: CDaoDatabase.Open()

    Are you sure that the database you try to open (when it already exists) isn't protected by a password ?

    If it is protected, you have to put in the lpszConnect parameter of the Open method :

    CString strConnect = ";pwd=" + strPassword; // strPassword contains the value of the password of course




    If you don't do that, you get a message saying that the ISAM driver can't be found ! I had once this problem.


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