isladogsHi, thank you for your reply
I am getting the same error as you in two cases:
1) when I run this vbs as x64 on machine with office x32 (basically to run these 4 lines as is)
2) when I force to run this code as x32 on machine with office x64. Here I use this trick to force to run it as x32. Full vbs text below.
In both cases that's the expected behaviour. x32 office should expose x32 dao which is not available from x64 and vice versa.
Error I am talking about - "The operating system is not presently configured" - happens when I try to connect DAO using the same x32/x64 bitness as Office installation. All this thread is dedicated to the breakthru that DAO/OLEDB connectiity should become available. And now instead of that connectivity I am getting endless occurence of that error.
CreateObject("Access.Application") - yes, it works fine, but that's not the subject of this discussion.
And here is the full vbs I use to foce x32 execution on x64 machine (sorry some formatting may be broken):
Call Force32bit
Dim DBEngine
Set DBEngine = CreateObject("DAO.DBEngine.120")
Call MsgBox("Access DB Engine - OK")
Set DBEngine = Nothing
Sub Force32bit()
Dim sWinDir, sSys64, sSys32, oShell
Set oShell = CreateObject("WScript.Shell")
sWinDir = oShell.ExpandEnvironmentStrings("%WinDir%")
With CreateObject("Scripting.FileSystemObject")
sSys64 = .BuildPath(sWinDir, "SysWOW64")
If Not .FolderExists(sSys64) Then Exit Sub
sSys32 = .BuildPath(sWinDir, "System32")
If sSys32 = WScript.Path Then
oShell.CurrentDirectory = sSys64
oShell.Run "wscript.exe " & Chr(34) & _
WScript.ScriptFullName & Chr(34), 1, False
WScript.Quit
End If
End With
End Sub