Importing dbase tables

S

Simon Catchpole

Can anyone help with exporting dbase tables into access. I'm finding that
some logical field information is being imported into excel wrongly.

I've tried converting my dbase table to a level 4 table, and most of the
information is correctly imported but not that for logical fields

For instance a test dbf containing the following information
Field1 Field2 Field3
A true true
B true true
C
D
E true
F true
G true
H true

gets imported into access and looks like
Field1 Field2 Field3
A -1 -1
B -1 -1
C -1 -1
D -1 -1
E -1 -1
F -1 -1
G -1 -1
H -1 -1

I've tried importing the information into Excel - no problem but get the
same result as above when the spreadsheet is opened by access.

Does this mean that it's the driver?

Any ideas much appreciated
 
J

Joe Fallon

False is defined as 0.
True is anything else.

So I think you need to modify your data to have false instead of blanks.
Then when you import it you should get -1 for True values and 0 for False
values.
 
S

Simon Catchpole

Hi Joe

Thanks for the response, I can see this works if I change the spreadsheet
and replace the blanks with 'FALSE' my problem now is that the dBase logical
fields are either checked - true or unchecked - false, so how would I ensure
this value is set to FALSE?

Also I notice that when I look at the table in access I see the values 0
& -1. If the table was created in Access I see TRUE - so how do I change the
imported table to show TRUE or FALSE?

Many thanks
 
J

Joe Fallon

The values *displayed* by Access can be the words true or False.
But the values *stored* in the tables are always -1 or 0.

Sometimes the tables even "trick" you because they can *display* other
values based on formatting.

So the goal is really just to get the right values in the table and worry
about displaying them later.

Access can import db files directly so you could skip the spreadsheet and
try that.

"dBase 5.0"
DoCmd.TransferDatabase acImport, "dBase 5.0", strLocalDir, acTable,
strFileName, strTableName
 
S

Simon Catchpole

Joe

Thanks for the response, unfortunately this is way past my access & visual
basic knowledge. Where can I find out how to run the code you've posted? For
instance do I need to create an access table first?

I had been trying to do this by using the "Get External Data" facility.

Many thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top