I am trying to update an MDB using a VBS script. On one machine it works OK (WinXP and Office 2003) but on the other (Win7 64 bits VM with Office 2010) I get the error "ActiveX Component can't create object: 'DAO.DBEngine.36'". The code:
Dim dbe
Set dbe = CreateObject("DAO.DBEngine.36")
I tried with DAO.DBEngine
, DAO.DBEngine.120
and .140
with no difference.
I don't understand where is the problem. Any clue ?
Update: I found I could make it work by callink the script like this:
c:\windows\syswow64\wscript MyScript.vbs Myargument
Apparently to call the 32 bits Wscript you must call it from syswow64, while the Wscript in system32 is the 64 bits version. A bit strange...