Page 1 of 1

Importing ODBC info into SQLite

Posted: Fri Jun 06, 2003 2:56 pm
by blueb
How would you go about importing a DBF table into a SQLite table? (Possibly ODBC, but not a requirement)

I'm using El_Choni's excellent library, if that helps.

Any info would make my day! 8)

--blueb

Posted: Fri Jun 06, 2003 9:18 pm
by Num3
The easiest way to import data from another database, say Microsoft Access is as follows:

·define a new table in a SQLite database
.Import the original (dbf) table into Access (Access reads most types of DB with Import)
·export the table from Access with tabs as field seperators and no quotes around text fields
·get the exported data in SQLite with COPY FROM

In the case of EasySQLite I had exported the programs table from my Access 2000 database to g:\jans\easySQLite\q_export.txt
Next within EasySQLite I did create a new programs table:
create table programs (id integer primary key, name, description, size, category
Finally I copied data from the q_export.txt file into the programs table with:

copy programs from "g:\jans\easySQLite\q_export.txt"

(This is part of the EasySQLight help, just added a few things)
:D

Posted: Sat Jun 07, 2003 1:49 am
by blueb
Thanks Num3! :)

I'll have to dust off my Access database program. I haven't used it in years (Office 97), but it might make this easier.

I was thinking of parsing a binary file byte by byte.... but that seemed to be a lot harder than your method.

I'll give it a try,

Thanks,
--blueb