Page 1 of 1
Convert a Dbase file to a base (hsqldb) table
Posted: Wed Apr 23, 2008 7:59 pm
by HWJ
Hi,
I'd like to convert a Dbase file (.dbf) to a table stored in a hsqldb table.
If I just say connect to an existing database, only the information to the path
containing the .dbf file is stored in, say, newdb.odb.
I'd like to get rid of the old .dbf file altogether.
Many thanks for a hint,
Helmut.
Re: Convert a Dbase file to a base (hsqldb) table
Posted: Wed Apr 23, 2008 8:05 pm
by Villeroy
Create a new database from scratch, which will be always a hsqldb. Create a second database linked to a dBase directory and drag the tables from the second into the first. A wizzard pops up... Take care of primary keys. Contrary to dBae, hsql needs PKs to make a table editable.
Re: Convert a Dbase file to a base (hsqldb) table
Posted: Wed Apr 23, 2008 8:23 pm
by HWJ
Villeroy wrote:Create a new database from scratch, which will be always a hsqldb. Create a second database linked to a dBase directory and drag the tables from the second into the first. A wizzard pops up...
Take care of primary keys. Contrary to dBae, hsql needs PKs to make a table editable.
Thanks, but sorry, I'm a newbee, how to do that?
I've tried to select an existing field (from the dbase file) but it was rejected saying it has already been selected
as primary key. But if I don't do that table creation fails because of a lacking primary key.
I'm using OO 2.4.0
Thanks for your help,
Helmut.
Re: Convert a Dbase file to a base (hsqldb) table
Posted: Wed Apr 23, 2008 8:42 pm
by Villeroy
If the former dBase table had no suitable candidate for a PK (some ID, unique number) then let the import wizard create a new one by checkíng the option. If there is such a field already, I think the table should be copied even without a primary key. Then open the table in edit mode and declare the respective field as PK (right-click).