Click to See Complete Forum and Search --> : CDaoDatabase.Open()


masterx
May 26th, 1999, 04:39 PM
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;

}

ans
May 31st, 1999, 06:18 AM
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.