Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const not defined. #354

Open
FinPl opened this issue Oct 12, 2022 · 5 comments
Open

const not defined. #354

FinPl opened this issue Oct 12, 2022 · 5 comments

Comments

@FinPl
Copy link

FinPl commented Oct 12, 2022

Hello, it seems like the commit 2d61d2 introduces a bug.
In fact the const SQL_STILL_EXECUTING as been removed from the const definitions and therefore isn't recognised as a return value.

@quinnj
Copy link
Member

quinnj commented Oct 12, 2022

@pankgeorg, would you mind taking a look?

@pankgeorg
Copy link
Contributor

Hey @FinPl ! This constant was defined twice in the file; I thought that was a mistake, that was why I removed it.

image

Can you share some minimal example where this breaks?

Thank you!

@FinPl
Copy link
Author

FinPl commented Oct 12, 2022

Ok, my bad, I thought that was the cause of the issue. I'll try to narrow it down.

@pankgeorg
Copy link
Contributor

Ok, my bad, I thought that was the cause of the issue. I'll try to narrow it down.

If it works on 1.1.1 and not on 1.1.2 it's probably something I did so I really want to help out.
Note that 1.1.2 will now throw on runtime errors like DivisionByZero error; the behaviour before was different - you got back the results up to the error.

Anything you can share is valuable!

Thanks,
Panagiotis

@FinPl
Copy link
Author

FinPl commented Oct 13, 2022

Hello, the problem has nothing to do with the last commit, I am very sorry for that.

It has something to do with the SQL_ATTR_AUTOCOMMIT set when begining a transaction().
It looks like results may vary depending on the way the functions are precompiled.
Everything works if we call API.setcommitmode(conn.dbc, true) on line 110 of load.jl
Do you have any recommendations ?

Here is a way to reproduce the error:

using ODBC, DataFrames
path = "yourPath.accdb"
conn = ODBC.Connection("DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" * path)
df = DataFrame(ABC=[1.,2.,3.])
ODBC.load(df,conn, "errorsRightAway")

ERROR: HY011: [Microsoft][Pilote ODBC Microsoft Access]Définition de l'attribut impossible à ce stage
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] setcommitmode(dbc::ODBC.API.Handle, on::Bool)
@ ODBC.API C:\Users\genc01.julia\packages\ODBC\9VZTC\src\API.jl:111
[3] transaction(f::ODBC.var"#46#47"{Bool, Int64, ODBC.Connection}, conn::ODBC.Connection)
@ ODBC C:\Users\genc01.julia\packages\ODBC\9VZTC\src\load.jl:110
[4] load(itr::DataFrame, conn::ODBC.Connection, name::String; append::Bool, quoteidentifiers::Bool, debug::Bool, limit::Int64, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ ODBC C:\Users\genc01.julia\packages\ODBC\9VZTC\src\load.jl:96
[5] load(itr::DataFrame, conn::ODBC.Connection, name::String)
@ ODBC C:\Users\genc01.julia\packages\ODBC\9VZTC\src\load.jl:74
[6] top-level scope
@ c:\Users\genc01\Documents\Github_repos\SCT_MDL\Admin\Modelisation\src\testODBC.jl:276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants