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

iODBC Driver Manager support #78

Closed
iotaaxel opened this issue Jun 29, 2018 · 6 comments
Closed

iODBC Driver Manager support #78

iotaaxel opened this issue Jun 29, 2018 · 6 comments

Comments

@iotaaxel
Copy link

iotaaxel commented Jun 29, 2018

I am trying to connect to a sqlite3 database to query a table. In my project, the connection string gives me the error 'Diagnostics returned error for record number 2. Record numbers have to be at least 1.'

I decided to download the crate individually to see if I could run test examples and figure out what is wrong with my code. None of the tests pass.

My output is below:
cargo_test_output.txt

Also, is there a list of dependencies need for this repo? I got a linker error until I used "brew install libiodbc".

@Koka
Copy link
Owner

Koka commented Jun 30, 2018

Actually, I've never tried this crate with iodbc, but should work too.
Can you please add more details on your environment?

Failing tests can be related not only to the crate itself, but also to environment, ODBC driver manager or driver and datasource setup.

The only native dependence of this crate is odbc driver manager. It should be already installed on Windows and for Linux and Mac you need to install it manually (like UnixODBC or iodbc)

@Koka
Copy link
Owner

Koka commented Jun 30, 2018

Also looks like you're calling get_diag_rec(2) somewhere while having only one diagnostic record, I quickly looked at the sources of this crate and it always does get_diag_rec(1), so this should be called manually somewhere in your code. Thats the reason why you have 'Diagnostics returned error for record number 2. Record numbers have to be at least 1' error

@iotaaxel
Copy link
Author

iotaaxel commented Jul 2, 2018

I am using rustc 1.28.0-nightly (e3bf634e0 2018-06-28) now on a Mac. I am also using Homebrew 1.6.9.

Thank you, I was able to get successful results by downloading the iODBC Driver Manager , running "brew install sqliteodbc", and set up dsn files.

Also, it appears your tests are hardcoded , so that may be why cargo test fails for me.

@Koka Koka added the tests label Jul 8, 2018
@ccakes
Copy link

ccakes commented Oct 17, 2018

Just an additional datapoint - on macOS 10.12 linking against libiodbc results in all tests failing, removed that and retried with unixodbc and all works fine.

I didn't try installing iODBC Driver Manager like OP did though.

@iotaaxel
Copy link
Author

I removed iODBC Driver Manager and now only have unixodbc. Thank you @ccakes

@Koka
Copy link
Owner

Koka commented Oct 18, 2018

So looks like iODBC doesn't work well with this crate. I'm renaming this issue to iODBC Driver Manager support request

@Koka Koka changed the title cargo test failure iODBC Driver Manager support Oct 18, 2018
@iotaaxel iotaaxel closed this as completed Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants