lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 7/22/07, varol kaptan <varol.kaptan@gmail.com> wrote:
package.path is for locations of lua code, not binary files like dlls.
In your case the error is due to the fact that oci8.dll is not a valid
lua source code. In short, there should be no "?.dll" in package.path.

Varol

On 7/22/07, David Venus <dvenus@hotmail.com> wrote:
>
>  Hi!
>  Hopefully this is a simple question. I am very new to lua but it is very
> cool. I need to be able to query Oracle databases. I am trying to use luasql
> 2.0.2 with lua 5.1.2 (most current versions if i have typed the numbers
> wrong) on Windows XP PRO SP2. All components came from luaforge.
>
>  Here is the error message:
>
>  'c:\temp.d\dmv.d\lua.d\bin\luasql\oci8.dll':
> c:\temp.d\dmv.d\lua.d\bin\luasql\oci8.dll:1: '=' expected
> near 'É'
> stack traceback:
> [C]: ?
> [C]: in function 'require'
>        test.lua:5: in main chunk
> [C]: ?
>
>
> Here is my code, copied from the luasql examples and modified
> for what I am trying to do:
>
>  -- load driver
> package.path = "c:\\temp.d\\dmv.d\\lua.d\\bin\\?.dll"
> package.cpath = "c:\\temp.d\\dmv.d\\lua.d\\bin\\?.dll"
> require "luasql.oci8"
> -- create environment
> objectenv = assert (luasql.oci8())
> -- connect to data source
> con = assert (env:connect("<server>", "<user>", "<password>"))
> cur = assert (con:execute"SELECT * from dual")
> -- print all rows, the rows will be indexed by field names
> row = cur:fetch ({}, "a")
> while row
>   do  print(string.format("%s", row))
>   -- reusing the table of results
>   row = cur:fetch (row, "a")
> end
> -- close everything
> cur:close()
> con:close()
> env:close()
>
> Any help, hints, etc. is greatfully appreciated. Please let me know if you
> need more info.
>
>  Thanks for your time and patience!
>
>  Dave Venus
>


Just incase that's not entirely clear (not to say you wouldn't
understand it of course!) he means, change the ?.dll to ?.lua in the
package.path, path.