-
Notifications
You must be signed in to change notification settings - Fork 63
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
Can't connect to azure db (v1.0.0 #289
Comments
Thanks for reporting! Can you try #290 and see if that at least prints the error correctly for us? You can get that code by doing |
It did not give any more info.
"/usr/local/Cellar/msodbcsql17/17.5.2.1/lib/libmsodbcsql.17.dylib"
julia> ODBC.adddriver("ODBC Driver 17 for SQL Server", sqldrv)
1
julia> ODBC.adddsn("varmedb", "ODBC Driver 17 for SQL Server"; SERVER=“dbserver", Database=“mydb", UID=“u", PWD=“xx" )
julia> cn = ODBC.Connection("varmedb")
ERROR: ??0: ???????????????????????????????????????.�� �� �� �� ��??0: ??????????????????????????????????????e�� �� �� �� ��
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] driverconnect(::String) at /Users/havard/.julia/packages/ODBC/S60aG/src/API.jl:114
[3] connect at /Users/havard/.julia/packages/ODBC/S60aG/src/API.jl:345 [inlined]
[4] ODBC.Connection(::String, ::Nothing, ::Nothing) at /Users/havard/.julia/packages/ODBC/S60aG/src/dbinterface.jl:34
[5] ODBC.Connection(::String) at /Users/havard/.julia/packages/ODBC/S60aG/src/dbinterface.jl:33
[6] top-level scope at none:0
julia> drv = "Driver=ODBC Driver 17 for SQL Server;"
"Driver=ODBC Driver 17 for SQL Server;"
julia> cnstr = “Server=dbserver;Database=mydb;Uid=u;Pwd=xx;";
julia> cn = ODBC.Connection(string(drv,cnstr), “u", “xx")
ERROR: ??0: ???????????????????????????????????????.?????????????????????????????????l*??0: ??????????????????????????????????????e?????????????????????????????????l*
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] driverconnect(::String) at /Users/havard/.julia/packages/ODBC/S60aG/src/API.jl:114
[3] ODBC.Connection(::String, ::String, ::String) at /Users/havard/.julia/packages/ODBC/S60aG/src/dbinterface.jl:34
[4] top-level scope at none:0
… On 4 Jun 2020, at 00:27, Jacob Quinn ***@***.***> wrote:
] add ODBC#jq/err
|
Btw, I managed to connect to the same server using a windows pc though it crashed whole Julia when disconnecting SQL server (ODBC32.dll error). I will send a separate issue on it even though it might not be ODBC.jl error. |
Ok, I think I tracked this down. It looks like the official Microsoft SQL Server ODBC driver was built against unixODBC (not iODBC which is default on osx). So just doing: ODBC.setunixODBC() then running In terms of a "fix" here, I'm not sure what we can do. I don't think there's a way to detect whether a driver was built against iODBC vs. unixODBC. I'll add a note to the docs to maybe try something like this and probably mention SQL server on OSX specifically since that seems like a common gotcha. |
Ok, I put up a PR that tries to point out the issue in the docs everywhere: #293 |
Thx it worked! Though I had to use adddsn() because connection string still does not work. Anyhow, I am happy to use dsn |
Could you share what you're seeing w/ the connection string? That's how I connected. Maybe check https://www.connectionstrings.com/microsoft-odbc-driver-17-for-sql-server/ for reference? |
I am using libmsodbcsql.17.dylib and get no errors when adding the driver and running ODBC.adddsn(...). Same error using connection string that have been working in previous version.
julia> using ODBC
julia> cn = ODBC.Connection(mydsn)
ERROR: Base.CodePointError{UInt32}(0x00380032)
Stacktrace:
[1] code_point_err(::UInt32) at ./char.jl:86
[2] Char at ./char.jl:160 [inlined]
[3] transcode(::Type{UInt8}, ::Array{UInt32,1}) at ./c.jl:286
[4] transcode at ./c.jl:292 [inlined]
[5] str(::Array{UInt32,1}, ::Int64) at /Users/havard/.julia/packages/ODBC/uLgtd/src/API.jl:58
[6] diagnostics(::ODBC.API.Handle) at /Users/havard/.julia/packages/ODBC/uLgtd/src/API.jl:545
[7] driverconnect(::String) at /Users/havard/.julia/packages/ODBC/uLgtd/src/API.jl:114
[8] connect at /Users/havard/.julia/packages/ODBC/uLgtd/src/API.jl:345 [inlined]
[9] ODBC.Connection(::String, ::Nothing, ::Nothing) at /Users/havard/.julia/packages/ODBC/uLgtd/src/dbinterface.jl:34
[10] ODBC.Connection(::String) at /Users/havard/.julia/packages/ODBC/uLgtd/src/dbinterface.jl:33
[11] top-level scope at none:0
The text was updated successfully, but these errors were encountered: