I got below code to working in Excel VBA.
Dim con, com
Const adCmdStoredProc = 4
Const scon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Accessdbpath.accdb;Persist Security Info=False;"
Set con = CreateObject("adodb.connection")
Set com = CreateObject("adodb.command")
con.Open scon
Set com.activeconnection = con
com.CommandType = adCmdStoredProc
com.CommandText = "accessqueryname"
com.Execute
Set com.activeconnection = Nothing
Set con = Nothing
I was trying to run the same routine in a server (no ms office).
So I tried creating a VBS file to do it instead of via Excel VBA.
However I can't seem to make it work. I got below error:
Edit1: I did check using the process explorer if I am running the script at 64/32 bit and I'm running at 64 bit.