Professional Documents
Culture Documents
Readme
Readme
------------------
http://www.ch-werner.de/sqliteodbc/sqliteodbc-*.tar.gz
http://www.ch-werner.de/sqliteodbc/sqliteodbc.exe
The binaries were made with SQLite 2.8.17, SQLite 3.8.6, MingW
cross compiler and tested on Windows NT 4.0 with the query tool
of MS Excel 97, with StarOffice 5.2 and OpenOffice 1.1 and 2.x.
Execute the sqliteodbc.exe NSIS installer to unpack the necessary
files. This installs the SQLite ODBC driver and creates a System DSN.
To remove the driver use the start menu entries or the UNINST.EXE
program. To create a SQLite data source use the ODBC control panel
applet and provide the name of the SQLite database file to be worked
on as an absolute pathname including the drive letter, eg as
"C:\TEMP\SQLite.DB". The busy (or lock) timeout for the database
can be specified in the respective field. If empty a default value
of 100000 milliseconds is used.
Other tests were made on Linux with the "isql" command line tool
and the "DataManager" GUI tool of unixODBC 2.1.0.
Since October 14th, 2001, the driver supports the data types SQL_INTEGER,
SQL_TINYINT, SQL_SMALLINT, SQL_FLOAT, SQL_DOUBLE, SQL_DATE, SQL_TIME,
SQL_TIMESTAMP, and SQL_VARCHAR.
The data type mapping obtains per-column meta information from the
"PRAGMA table_info(...)" SQLite statement. If SELECTs are used which
contain columns for which the table qualifier cannot be determined,
no meta information for data type mapping is available and therefore
the database source data type will be SQL_VARCHAR or SQL_LONGVARCHAR
which usually maps to SQL_C_CHAR.
followed by
# make install
Since May 15th, 2003, (version 0.51), there are two variants
of the SQLite 2.x driver for Win32 platforms: the first (sqliteodbc.dll)
linked against ISO8859-1 SQLite library exporting ODBC/SQL ANSI
functions, and the second (sqliteodbcu.dll) linked against UTF-8
SQLite library exporting ODBC/SQL UNICODE functions.
[SQLite]
Description=SQLite ODBC Driver
Driver=/usr/local/lib/libsqliteodbc.so
Setup=/usr/local/lib/libsqliteodbc.so
Threading=2
[mysqlitedb]
Description=My SQLite test database
Driver=SQLite
Database=/home/johndoe/databases/mytest.db
# optional lock timeout in milliseconds
Timeout=2000
[ODBC Drivers]
...
SQLite=Installed
...
[SQLite]
Driver=/usr/local/lib/libsqliteodbc.so
[mysqlitedb]
Driver=/usr/local/lib/libsqliteodbc.so
Description=My SQLite test database
Database=/home/johndoe/databases/mytest.db
# optional lock timeout in milliseconds
Timeout=2000
$ python
>>> import mx.ODBC.unixODBC
>>> dbc=mx.ODBC.unixODBC.connect("mysqlitedb")
>>> cur=dbc.cursor()
>>> cur.execute("create table foo (id int, name string)")
1
>>> cur.execute("insert into foo values(1, 'Me')")
1
>>> cur.execute("insert into foo values(2, 'You')")
1
>>> dbc.commit()
>>> cur.execute("select * from foo")
>>> print cur.fetchall()
[(1, 'Me'), (2, 'You')]
>>> print cur.fetchall()
[]
>>> cur.execute("drop table foo")
1
>>> dbc.commit()
nmake -f sqliteodbc.mak
nmake -f sqlite3odbc.mak
This compiles the amalgamation SQLite3 source and the ODBC driver
first, then and links the ODBC driver and the (un)install program.
Each driver DLL provides entry points for ODBC driver installation
and removal which can be invoked from RUNDLL32.EXE, eg
Win64 notes
On Win64 (64 bit versions of Vista, Windows 7) both 32 bit and 64 bit
drivers can be installed in parallel. The 32 bit drivers are required
when using 32 bit applications. In order to manage 32 bit data
sources, the 32 bit ODBC admin tool C:\Windows\SysWOW64\odbcad32.exe
must be used.
DSN=SQLite Datasource;Database=full-path-to-db;...
DSN=SQLite3 Datasource;Database=full-path-to-db;...
alternatively
Win32:
Driver=SQLITE;Database=full-path-to-db;...
Driver=SQLITE3;Database=full-path-to-db;...
Build Instructions for Alpha/Tru64 (OSF1 V5.1) and HP/UX (B.11.23 U ia64)
sqlite (3.6.7):
./configure --prefix=$HOME/development --disable-tcl \
CC='cc -pthread' CFLAGS='-DSQLITE_ENABLE_COLUMN_METADATA=1'
gmake && gmake install
unixODBC (2.2.12):
./configure --prefix=${HOME}/development --disable-gui \
--without-x --enable-iconv=no
gmake && gmake install
sqliteodbc (>0.79):
./configure --with-sqlite3=${HOME}/development \
--with-odbc=${HOME}/development --prefix=${HOME}/development \
--enable-winterface=no
OSF1: gmake && gmake install
HP/UX: gmake CFLAGS="+DD64" && gmake install
TODO:
- improve documentation
2014-09-20
Christian Werner
mailto:chw@ch-werner.de