tags:

views:

1163

answers:

2

Is it possible to connect to SQLite in C++ and using ODBC API without register the database in ODBC?

I have code that uses ODBC talking to databases and don't want to rewrite for using SQLite and don’t want to register new ODBC connections.

+2  A: 

you should be able to do it without any code changes using sqliteodbc.

rev
This is a nice tool. It installs the ODBC driver for you and after installing it, you simply configure a DSN that connects to a file.
bobobobo
+1  A: 

Short answer, use one of the following connection strings:

Driver=SQLite ODBC Driver;Database=full-path-to-db;...
Driver=SQLite3 ODBC Driver;Database=full-path-to-db;...

Long answer: The readme file included with the sqliteodbc driver covers the methods for connecting, using a DSN-less connection string.

See http://www.ch-werner.de/sqliteodbc/html/index.html

Justdoro