8
« on: February 11, 2019, 05:12:46 PM »
When running the code below from the Zerobrane Studio:
package.path = package.path .. ";.\\Modules\\?.lua;.\\Modules\\?.mcs"
-- mysql.dll and odbc.dll are in the addons path so I included a direct reference search path of AddOns
package.cpath = package.cpath .. ";.\\Modules\\?.dll;.\\Modules\\AddOns\\?.dll"
-- load driver
local driver = require "luasql.odbc"
-- if I run this in the mcLUAEditor - debug the script exits with exit code -1 (I assume that means it could not find the driver
-- my macros are located here .. C:\Mach4\Profiles\Mill\Macros
-- create environment object
env = assert (driver.odbc())
-- connect to data source
con = assert (env:connect("mycnc_v1"))
-- reset our table
res = assert (con:execute(string.format([[
INSERT INTO operator
VALUES ('Me', 'Myself')]], FirstName, LastName)
))
con:close()
env:close()
I get the Error output :
Program starting as '"C:\Mach4\ZeroBraneStudio\bin\lua52.exe" -e "io.stdout:setvbuf('no')" "C:\Users\MACHMO~1\AppData\Local\Temp\.3F36.tmp"'.
Program 'lua52.exe' started in 'C:\Mach4\Profiles\Mill\Macros' (pid: 3588).
C:\Mach4\ZeroBraneStudio\bin\lua52.exe: C:\Users\MACHMO~1\AppData\Local\Temp\.3F36.tmp:1: module 'machipc' not found:
no field package.preload['machipc']
no file 'C:\Mach4\Modules/machipc.lua'
no file 'C:\Mach4\ZeroBraneStudio\bin\lua\machipc.lua'
no file 'C:\Mach4\ZeroBraneStudio\bin\lua\machipc\init.lua'
no file 'C:\Mach4\ZeroBraneStudio\bin\machipc.lua'
no file 'C:\Mach4\ZeroBraneStudio\bin\machipc\init.lua'
no file '.\machipc.lua'
no file './machipc.lua'
no file './machipc/init.lua'
no file './lua/machipc.lua'
no file './lua/machipc/init.lua'
no file 'C:\Mach4\ZeroBraneStudio\lualibs/machipc/machipc.lua'
no file 'C:\Mach4\ZeroBraneStudio\lualibs/machipc.lua'
no file 'C:\Mach4\ZeroBraneStudio\lualibs/machipc/machipc/init.lua'
no file 'C:\Mach4\ZeroBraneStudio\lualibs/machipc/init.lua'
no file 'C:\Mach4\Modules/machipc.dll'
no file 'C:\Mach4\ZeroBraneStudio\bin/clibs52/machipc.dll'
stack traceback:
[C]: in function 'require'
C:\Users\MACHMO~1\AppData\Local\Temp\.3F36.tmp:1: in main chunk
[C]: in ?
Program completed in 0.19 seconds (pid: 3588).