Access data import

S

San

Hi all

is it possible some how to import .DAT files into access? I have an old
database which stores data in .Dat files and I would like to know if it
is at all possible to some how convert and import them to access so I
don't have to retype 500 pages of data into access manuelly!!!


thanks
 
A

Arvin Meyer [MVP]

Try to convert the DAT file to text first. Also, Excel may be able to read
the data. Access does not directly read any data file with the DAT
extension. That extension is widely used for many different formats, so you
need to convert your orignial data into something that Access can easily
read (txt, csv, xls, dbf)
 
S

San

Thx

I tried that but then I still would have to do it one at the time...and
I have over 500 DAT files :( besides the form was all wrong when I
imported it.

So basicly there is no way I can make access load 500 files and put it
in one database so I can (add, remove and so on) like in a normal
database even though I convert the files to txt.

thanks








Arvin Meyer [MVP] skrev:
 
J

John Vinson

Thx

I tried that but then I still would have to do it one at the time...and
I have over 500 DAT files :( besides the form was all wrong when I
imported it.

So basicly there is no way I can make access load 500 files and put it
in one database so I can (add, remove and so on) like in a normal
database even though I convert the files to txt.

DAT is just a meaningless three letter extension, which was used
extensively in DOS to mean just any kind of data file. DAT files may
well be simple text files, or they might be highly structured or even
binary files - without inspecting the files there's no way to be sure.

If you want to be able to edit the data then you will need to actually
import it into Access tables. Linked text files (of whatever
extension) are not editable.

You can certainly use VBA code to open the files and read them into
Access tables, but how simple or complex that code would be depends on
the nature of the files.

If the data isn't confidential, perhaps you could post three or four
lines of the data, including a header if there is one? Could you also
indicate what you meant by "the form was all wrong"?

John W. Vinson[MVP]
 
S

San

Yeah sure I'll try...


uh...the dat files are actually just a few linies of text...like this

------------------------------------------------------------------------------------------------------------------
000002 ' this is the no. 2 file in
the database
Power Supply 0-40V 0-10A ' this is the product name
01 ' Type of product. No 01 is showen as "Powesupply" when the
database is run.
En justerbar str›mforsyning, der kan indstilles til en sp'nding
mellem 0 og 40
volt, og til en max str›m mellem 0 og 10 A.

Str›mforsyningen har softstart ved power on. ' the text you don't
understand is just the product descriptions in danish





A ' this is A for analog. it can be M or D which is either mechanical
or digital but it can be all more than one.

28/1 1992 ' date ofcourse


SG ' the initials of the maker
------------------------------------------------------------------------------------------------------------------


The comments are added by me but the rest is exactly as is in the dat
file. And what i mean about the form is all wrong is that when I import
the file into access the table it also take the emty linies. and when I
try to make a form it looks funny...I think it is easier if you copy
the text and try to see for yourself.

thank for the reply

John Vinson skrev:
 
J

John Vinson

Yeah sure I'll try...


uh...the dat files are actually just a few linies of text...like this

------------------------------------------------------------------------------------------------------------------
000002 ' this is the no. 2 file in
the database
Power Supply 0-40V 0-10A ' this is the product name
01 ' Type of product. No 01 is showen as "Powesupply" when the
database is run.
En justerbar str›mforsyning, der kan indstilles til en sp'nding
mellem 0 og 40
volt, og til en max str›m mellem 0 og 10 A.

Str›mforsyningen har softstart ved power on. ' the text you don't
understand is just the product descriptions in danish

Since each record spans more than one line, you will need some VBA
code to read the records and put the data into a table. How can you
tell when you get to a new "file" as you call it? If the description
can run to any arbitrary number of lines, you can't just count
records; what's the cue to indicate that you're now on a new item?

John W. Vinson[MVP]
 
S

San

well actually thats is just one file...I have 509 file that look
similar tol that...



John Vinson skrev:
 
J

John Vinson

well actually thats is just one file...I have 509 file that look
similar tol that...

So if you look at this directory in Windows Explorer it has 509
separate .DAT files, each with these - what, three lines?

If so you'll still need some VBA code to read them in. It's a bit more
than I feel comfortable trying to write on a volunteer basis but it
shouldn't be all that hard.

John W. Vinson[MVP]
 
S

San

yeah thats what I mean 509 seperate .DAT files unfortunately....well
there are more than 3 lines there at actually 35 I think but most of
them are emty lines. ussually only about 10 or so but it varies because
of the description part.

thx anyways


John Vinson skrev:
 

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