Microsoft DAO usage problems with Inno Setup 5.5.9 and higher

45 views
Skip to first unread message

Максим Индтрадов

unread,
Oct 5, 2021, 1:13:23 PM10/5/21
to innosetup
Hello! Need help!

I ran into a problem when working with Microsoft DAO and Inno Setup versions 5.5.9 and higher.

I need to change the mdb database (while installing application), but this is not possible, since the COM object works fine only with versions up to 5.5.8. Version 5.5.9 uses SetDefaultDllDirectories, which prevents the mdb engine from loading.

On opening the database, I receive an error message
Error 3446. DAO.DbEngine: Jet VBA file (VBAJET.dll for 16-bit versions, or VBAJET32.dll for 32-bit versions) is missing.
In Innp Setup 5.5.8 all works fine.

Sample code:
DAO:=CreateOleObject('DAO.DBEngine.36');
DAO.OpenDatabase('d:\database.mdb', false, false, ''); <--Exception

Is there a way to change the behavior of Inno Setup to temporarily allow DAO to work (load library form other sources)?

I tried different options (combinations) and it didn't work:
LoadDLL(ExpandConstant('{sys}\mscoree.dll'), ErrorCode);
SetDllDirectory(ExpandConstant('{syswow64}'));
SetDllDirectory(ExpandConstant( {syswow64}'));
AddDllDirectory(ExpandConstant('{dao}'));
SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_APPLICATION_DIR or LOAD_LIBRARY_SEARCH_DEFAULT_DIRS or LOAD_LIBRARY_SEARCH_SYSTEM32 or LOAD_LIBRARY_SEARCH_USER_DIRS);
SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32);
SetSearchPathMode(BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE);


Максим Индтрадов

unread,
Oct 18, 2021, 6:45:09 AM10/18/21
to innosetup
Martijn, Gavin do you have any ideas?

вторник, 5 октября 2021 г. в 20:13:23 UTC+3, Максим Индтрадов:
Reply all
Reply to author
Forward
0 new messages