Importing ODBC info into SQLite

Just starting out? Need help? Post your questions and find answers here.
User avatar
blueb
Addict
Addict
Posts: 1118
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Importing ODBC info into SQLite

Post 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
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post 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
User avatar
blueb
Addict
Addict
Posts: 1118
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Post 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
Post Reply