C
codewiz51
Guest
After KB950749 was installed, we have some legacy DAO code that is failing.
We have found that we cannot create and append fields to tabledefs from our
C++ code. I have not tried the equivalent in VBA. I know that DAO is
obsolete, but we did not see the need to upgrade legacy applications.
I have extracted some working code that is in production. After KB950749 is
installed, the following code fails:
#import <C:\Program Files\Common Files\Microsoft Shared\DAO\dao360.dll>
rename("EOF", "EndOfFile")
CComPtr<DAO::_DBEngine> m_DBE;
DAO:atabasePtr m_CurrDB;
DAO::_TableDefPtr tdfDestTable;
DAO::_FieldPtr fldNew;
m_DBE.CoCreateInstance(__uuidof(DAO:BEngine));
m_CurrDB = m_DBE->CreateDatabase(_bstr_t(m_szMDFFile),
_bstr_t(DAO::dbLangGeneral),
_variant_t(DAO::dbVersion40));
tdfDestTable = m_CurrDB->CreateTableDef(_T("MyTable"));
// DAO error 3421 occurs here after KB is installed
fldNew = tdfDestTable->CreateField(_T("MyField"), DAO::dbText, 12);
I have a complete console application documented at
http://codewiz51.blogspot.com. (This is not an advertisement for my blog,
the app is just too long for inclusion in this message.)
If this is not posted to the correct forum, please let me know where I might
post the problem.
Thanks,
code
We have found that we cannot create and append fields to tabledefs from our
C++ code. I have not tried the equivalent in VBA. I know that DAO is
obsolete, but we did not see the need to upgrade legacy applications.
I have extracted some working code that is in production. After KB950749 is
installed, the following code fails:
#import <C:\Program Files\Common Files\Microsoft Shared\DAO\dao360.dll>
rename("EOF", "EndOfFile")
CComPtr<DAO::_DBEngine> m_DBE;
DAO:atabasePtr m_CurrDB;
DAO::_TableDefPtr tdfDestTable;
DAO::_FieldPtr fldNew;
m_DBE.CoCreateInstance(__uuidof(DAO:BEngine));
m_CurrDB = m_DBE->CreateDatabase(_bstr_t(m_szMDFFile),
_bstr_t(DAO::dbLangGeneral),
_variant_t(DAO::dbVersion40));
tdfDestTable = m_CurrDB->CreateTableDef(_T("MyTable"));
// DAO error 3421 occurs here after KB is installed
fldNew = tdfDestTable->CreateField(_T("MyField"), DAO::dbText, 12);
I have a complete console application documented at
http://codewiz51.blogspot.com. (This is not an advertisement for my blog,
the app is just too long for inclusion in this message.)
If this is not posted to the correct forum, please let me know where I might
post the problem.
Thanks,
code