Dinbandhu wrote:
> I followed Barbara's instructions for exporting one's MSA database as
> a .csv file, and it worked perfectly. Now on the desktop of the Windows
> partition I have that file. It is a "Microsoft Excel Comma Separated
> Values File", and has the suffix .csv.
> 
> Could someone tell me how to import this .csv file into an OO Base
> file?. I am running a dual boot computer with Win 98 in one partition
> and Ubuntu Feisty in the other. OO Base is on the Feisty partition. (My
> other computer is a dual boot with XP and Feisty. I don't guess it makes
> much difference for the task at hand.) Thanks!
> 
> Regards,
> Swarup


>From what I've read so far you are running Ubuntu and you can connect to
the mdb in read-only mode. If you do so, you get a Base file (*.odb) and
when you hit F4 in Writer or Calc you see your mdb as datasource with
it's tables. If your mdb does not show up in the datasource window, call
Tool>Options>Base>Databases and register the odb file.

Open the target database or create a blank new one.

I'll use a spreadsheet as "mediator" and assume the following preconditions:
- Your Access tables are small. They have up to 256 columns and up to
65536 rows (including one row of field names).
- Your Access tables have primary keys and you want to recreate the
relations in the target database.
- Your tables include dates, times and date/times. The import wizzard
has some problems with dates, which can be solved with the help of a
spreadsheet.
- You have noticed the names of tables, fields, their data types and if
they allow null values. It is important that you use identical data
types for all related fields across tables. Access has some report tool,
but a pencil and paper record should do as well.

OK, File>New>Spreadsheet
Get the datasource window (F4), browse to your mdb-datasource, and pick
a first table, which should include some date/time, and drag the table's
icon from the left pane of the datasource window to the top-left cell of
your blank spreadsheet. You get a data copy in the sheet.
My date/time field is named "GMT" and it occupies column "I" of the
spreadsheet. Cell I1 has the "GMT" header and the cells below show
(German) date/times like "29.05.02 13:30".
Get the first unused column (let's say "K") enter field name GMT in K1,
change the original header to "SKIP" or something, select K2 and hit
Ctrl+Shift+End this highlights the entire used range from K2 until the
end of the list. The input focus is in the last cell (K97 in my case).
Now type =TEXT(I97;"YYYY-MM-DD HH:MM:SS") and finish the input with
Alt+Enter. This converts the numeric value in column "I" of this row
(97) to a text-value, representing the ISO-date. Alt+Enter puts the
formula into all highlighted cells. "2002-05-29 13:30:00".
If you don't get the desired ISO-date, your office operates with a
non-english locale. Call "Format>Cells..." and have a look at the
pre-defined date/time formats on tab "Numbers". With my German office
I've got to use =TEXT(I97;"JJJJ-MM-TT HH:MM:SS") instead of
=TEXT(I97;"YYYY-MM-DD HH:MM:SS").

How to change column order (let's say move "K" to "B"):
Click the grey header of "B" and call "Insert Column" from the context
menu. You get a blank column "B" inserted, subsequent columns move to
the right.
Select column "L" (which was "K" before insertion)  and cut (Ctrl+X)
Select column "B" and paste (Ctrl+V)
Select "L" again and call "Delete Columns".
This works with more than one adjacent column as well.

May be a good point to save the spreadsheet, just in case ...

Now copy the entire used range into clipboard:
Ctrl+Pos1, Ctrl+Shift+End, Ctrl+C

Activate your target database, select the tables container, right-click
into the white space and choose "Paste...".
The following wizzard lets you specify a table name.
Choose option "Definition and data". Don't check option "Create primary
key", since you want to reuse your original IDs.
In the next step click ">>" in order to choose all fields, select the
original date-time field we have labeled "SKIP" and put it back to the
left side. It may cause trouble. We use the converted ISO-strings instead.
The next step is crucial. For each field you have to specify data types,
and if null values should be allowed. You can also change the field
names. Make shure that all types match with the types of fields you want
to create relations for.

When you finish the wizzard, you'll propably get some error. Don't
bother, continue. Your table will be blank, since there is no primary
key yet. Choose "Edit" from the new tables context menu and "Primary
Key" from the context menu of your ID field. You may define additional
indices at this point.

Still having the data in the clipboard, close the saved table and call
again "Paste" from it's context menu.
Repeat the import with option "append data" and the right table name.
In the second step uncheck the "SKIP" field and move it to the end of
the list, so you have the corresponding fields side by side.
Now your data should import well. Don't they?

Use other sheets of the same spreadsheet document or new documents for
the other tables. Once you have imported all your tables, you should
create more indices (if required) and restore the relations.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to