You can't use the Lua module files from the 4088 build in the 3804 build. The reason is that the 4088 uses Lua 5.3 where 3804 uses Lua 5.2. Copying the lua53.dll file into the 3804 directory didn't do much other than let the 5.3 module go a step further. However, the Mach GUI and core are still Lua 5.2, which is causing the 0xc0000005 exception.
So yes, you need to upgrade the Mach 4 software on the target machine to use the Lua 5.3 modules from 4088. However, knowing that it is a Mach Motion Win 7 Embedded control, I would not do that. It will break a TON of their screen scripts. So I went looking for Lau 5.2 versions of the luasql modules and found them in a later build. They are attached.
Steve