Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
share|improve this question

1 Answer 1

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.

share|improve this answer
    
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 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 at 7:27
    
@DánjalSalbergAdlersson - another example: lojze.lugos.si/~darja/software/r/library/RODBC/README –  slm Feb 4 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 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 at 13:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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