4

I installed unixodbc, sqlite3 and libsqliteodbc.

odbcinst.ini looks like this:

[SQLite]
Description=SQLite ODBC Driver
Driver=libsqliteodbc.so
Setup=libsqliteodbc.so
UsageCount=2

[SQLite3]
Description=SQLite3 ODBC Driver
Driver=libsqlite3odbc.so
Setup=libsqlite3odbc.so
UsageCount=1

odbc.ini looks like this:

[mysqlitedb]
Description=My SQLite database
Driver=SQLite3
Database=/my_database.db

When I test connection like this:

isql -v mysqlitedb

it says Connected!

But when I try a SELECT statement it says:

SQL> select * from user
[S1000][SQLite]no such table: user (1)
[ISQL]ERROR: Could not SQLPrepare

What is wrong?

I known the table: user is present, because I get results when I do this:

sqlite3 /my_database.db
SQLite version 3.8.2 2013-12-06 14:53:30
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select * from user;
1|admin|password

closed as off-topic by Kusalananda, Anthon, Braiam, sam, slm Jul 30 '16 at 21:24

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Kusalananda, Anthon, sam, slm
If this question can be reworded to fit the rules in the help center, please edit the question.

  • I can not reproduce this on OS X with unixodbc-2.3.4, sqliteodbc-0.9994, and a database in my $HOME, nor with the database in /. (i.e it works as expected) – Kusalananda Jul 30 '16 at 6:29
0

You sure about this path in your odbc.ini file?

Database=/my_database.db

I would make sure that you don't need to specify the actual path to the sqlite DB file there.

  • Now I am not sure how isql works. I set the path to a database that does not exists. It says Connected! There are no tables in the database, so I create some and then I quit isql. I search the disk to see if the a database is create, but I do not find any. – Dánjal Salberg Adlersson Feb 3 '14 at 10:40
  • @DánjalSalbergAdlersson - Examples I'm finding on the net show it as a full path. So that would be putting that file at the / directory. Can you confirm if it's there or not? Also you can locate files often times using this command locate my_database.db. – slm Feb 4 '14 at 7:27
  • @DánjalSalbergAdlersson - another example: lojze.lugos.si/~darja/software/r/library/RODBC/README – slm Feb 4 '14 at 7:40
  • I tried changing location of DB and changing full path, but it still does not work. I check for leading spaces in config, but that did not help. I am wondering if there is something wrong with the drivers? I checked the dependencies of the drivers and they seem OK. – Dánjal Salberg Adlersson Feb 5 '14 at 10:56
  • @DánjalSalbergAdlersson - I tried to set this up on my Fedora 19 system and I haven't gotten it working yet either. Was there a guide you were following for the setup? This combination seems unused, I found very little info on unixODBC + sqlite. – slm Feb 5 '14 at 13:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.