By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,626 Members | 1,653 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,626 IT Pros & Developers. It's quick & easy.

:DAT import to access

P: n/a
Hi all

I was wondering if it was possible to some how import .DAT files into
access form?

I have over 500 DAT files which contains infomation about various
components and I wouldn't want to rewrite all of them into Access one
by one! Is there a way to convert the files so i can just import the
files easy and fast.

If it isn't possible pls say so, so I can tell my boss that it can't be
done...waste of time trying to do something that can't be done right.
many thanks

Oct 9 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
DAT is a file extension used by a number of different programs without
knoing the format of these data files it's not possibl to answer your
question.

--

Terry Kreft
<ja********@12move.dkwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi all

I was wondering if it was possible to some how import .DAT files into
access form?

I have over 500 DAT files which contains infomation about various
components and I wouldn't want to rewrite all of them into Access one
by one! Is there a way to convert the files so i can just import the
files easy and fast.

If it isn't possible pls say so, so I can tell my boss that it can't be
done...waste of time trying to do something that can't be done right.
many thanks

Oct 9 '06 #2

P: n/a
Well

there are just text in the file if thats what you mean...
Terry Kreft skrev:
DAT is a file extension used by a number of different programs without
knoing the format of these data files it's not possibl to answer your
question.

--

Terry Kreft
<ja********@12move.dkwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi all

I was wondering if it was possible to some how import .DAT files into
access form?

I have over 500 DAT files which contains infomation about various
components and I wouldn't want to rewrite all of them into Access one
by one! Is there a way to convert the files so i can just import the
files easy and fast.

If it isn't possible pls say so, so I can tell my boss that it can't be
done...waste of time trying to do something that can't be done right.
many thanks
Oct 11 '06 #3

P: n/a
No it's not.

That could mean:-

FieldName1, FieldName2, FieldName3
Data1, Data2, Data3

or
Data1, Data2, Data3

or
"Data1", "Data2", "Data3"

or
"FieldName1", "FieldName2", "FieldName3"
"Data1", "Data2", "Data3"

or
FieldName1 FieldName2 FieldName3
Data1 Data2 Data3

or
Data1
Data2
Data3

or
FieldName1
FieldName2,
FieldName3
Data1
Data2
Data3

or
FieldName1 = Data1
FieldName2 = Data2
FieldName3 = Data3

or anyone of a number of other variations.

If you want some help jut show us some sample data.

--

Terry Kreft
<ja********@12move.dkwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Well

there are just text in the file if thats what you mean...
Terry Kreft skrev:
DAT is a file extension used by a number of different programs without
knoing the format of these data files it's not possibl to answer your
question.

--

Terry Kreft
<ja********@12move.dkwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi all
>
I was wondering if it was possible to some how import .DAT files into
access form?
>
I have over 500 DAT files which contains infomation about various
components and I wouldn't want to rewrite all of them into Access one
by one! Is there a way to convert the files so i can just import the
files easy and fast.
>
If it isn't possible pls say so, so I can tell my boss that it can't
be
done...waste of time trying to do something that can't be done right.
>
>
many thanks
>

Oct 11 '06 #4

P: n/a
Ok this is one of the files opened in notepad
------------------------------------------------------------------------------------------------------------------------------000004
IRC2020 kommunikation
03
Seriel kommunikation mellem IRC 2020 omdrejningst'ller og PC.
Default : 9600,N,8,1
Mulighed for ops'tninger :
300/600/1200/2400/4800/9600 BAUD
NONE/ODD/EVEN parity
7/8 databit
1/2 stopbit

D
8031
6/11 1991
Ruud Min - Holland

SG






1500
------------------------------------------------------------------------------------------------------------------------------
Opened in access it looks like this. There isn't enough space so i have
just written which field they belong to in ( )

------------------------------------------------------------------------------------------------------------------------------

ID Field1 Field2 Field3 Field4
Field5
1 000004
2 IRC2020 kommunikation
3 03
4 Seriel kommunikation mellem IRC 2020(Field2)
omdrejningst'ller(Field3) og(Field4) PC.(Field5)
5 Default : 9600,N,8,1
6 Mulighed for ops'tninger :
7 300/600/1200/2400/4800/9600 BAUD(Field2)
8 NONE/ODD/EVEN parity
9 7/8 databit
10 1/2 stopbit
11
12 D
13 8031
14 6/11 1991
15 Ruud Min - Holland
16
17 SG
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 1500
35
------------------------------------------------------------------------------------------------------------------------------
And this is part of the code from the old program...if it helps in any
way.

------------------------------------------------------------------------------------------------------------------------------

TYPE
KatType = String[2];
BeskrivType = Array [0 .. 640] of Char;
KonstruktionsTabel = Record
OpgaveNr : LongInt;
OpgaveNavn : String[50];
Kategori : KatType;
Beskrivelse : BeskrivType;
DAM : String[3];
CPU : String[15];
Dato : Array [1 .. 5] of String[10];
Rekvirent : Array [1 .. 5] of String[22];
Modtager : Array [1 .. 5] of String[22];
Udfoert : Array [1 .. 5] of String[22];
Pris : STRING[5];
Tid : STRING[40];
END;

KategoriType = Array [0 .. 30] of String[50];

Streng6 = String[6];
SogeKriterierType = Record
OpgaveNr : Streng6;
OpgaveNavn : String[50];
Kategori : KatType;
Beskrivelse : String[66];
DAM : String[3];
CPU : String[15];
DatoFra : String[10];
DatoTil : String[10];
Rekvirent : String[22];
Modtager : String[22];
Udfoert : String[22];
Pris : STRING[5];
Tid : STRING[40];
END;

------------------------------------------------------------------------------------------------------------------------------
Hope you can make anything of this
Terry Kreft skrev:
No it's not.

That could mean:-

FieldName1, FieldName2, FieldName3
Data1, Data2, Data3

or
Data1, Data2, Data3

or
"Data1", "Data2", "Data3"

or
"FieldName1", "FieldName2", "FieldName3"
"Data1", "Data2", "Data3"

or
FieldName1 FieldName2 FieldName3
Data1 Data2 Data3

or
Data1
Data2
Data3

or
FieldName1
FieldName2,
FieldName3
Data1
Data2
Data3

or
FieldName1 = Data1
FieldName2 = Data2
FieldName3 = Data3

or anyone of a number of other variations.

If you want some help jut show us some sample data.

--

Terry Kreft
<ja********@12move.dkwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Well

there are just text in the file if thats what you mean...
Terry Kreft skrev:
DAT is a file extension used by a number of different programs without
knoing the format of these data files it's not possibl to answer your
question.
>
>
>
--
>
Terry Kreft
>
>
<ja********@12move.dkwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi all

I was wondering if it was possible to some how import .DAT files into
access form?

I have over 500 DAT files which contains infomation about various
components and I wouldn't want to rewrite all of them into Access one
by one! Is there a way to convert the files so i can just import the
files easy and fast.

If it isn't possible pls say so, so I can tell my boss that it can't
be
done...waste of time trying to do something that can't be done right.


many thanks
Oct 11 '06 #5

P: n/a
I hate them when they're like that.

OK, what you need to do here is use File I/O to get each line from the file
and then assign it to the correct field. I appreciate the thought behind
putting the target fields in brackets but it doesn't really make it much
clearer to me as to what goes where so I'll talk in general about what you
need to do and if you need any more help we can take it from there.

So a bit of sample code to quickly read all the data from the file:-

Sub ImportData(FileName As String)
Dim intFF As Integer
Dim strLine As String
Dim varLines As Variant
Dim intLine As Integer

intFF = FreeFile

Open FileName For Binary Access Read Lock Read Write As intFF

strLine = Space(LOF(intFF))
Get intFF, , strLine
Close intFF

varLines = Split(strLine, vbCrLf)

' Now you can step through the varLines array
' and put the relevant data into the correct
' fields in your table.

End Sub

--

Terry Kreft
<ja********@12move.dkwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Ok this is one of the files opened in notepad
--------------------------------------------------------------------------
----------------------------------------------------000004
IRC2020 kommunikation
03
Seriel kommunikation mellem IRC 2020 omdrejningst'ller og PC.
Default : 9600,N,8,1
Mulighed for ops'tninger :
300/600/1200/2400/4800/9600 BAUD
NONE/ODD/EVEN parity
7/8 databit
1/2 stopbit

D
8031
6/11 1991
Ruud Min - Holland

SG






1500
--------------------------------------------------------------------------
----------------------------------------------------
Opened in access it looks like this. There isn't enough space so i have
just written which field they belong to in ( )

--------------------------------------------------------------------------
----------------------------------------------------
>
ID Field1 Field2 Field3 Field4
Field5
1 000004
2 IRC2020 kommunikation
3 03
4 Seriel kommunikation mellem IRC 2020(Field2)
omdrejningst'ller(Field3) og(Field4) PC.(Field5)
5 Default : 9600,N,8,1
6 Mulighed for ops'tninger :
7 300/600/1200/2400/4800/9600 BAUD(Field2)
8 NONE/ODD/EVEN parity
9 7/8 databit
10 1/2 stopbit
11
12 D
13 8031
14 6/11 1991
15 Ruud Min - Holland
16
17 SG
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 1500
35
--------------------------------------------------------------------------
----------------------------------------------------
And this is part of the code from the old program...if it helps in any
way.

--------------------------------------------------------------------------
----------------------------------------------------
>
TYPE
KatType = String[2];
BeskrivType = Array [0 .. 640] of Char;
KonstruktionsTabel = Record
OpgaveNr : LongInt;
OpgaveNavn : String[50];
Kategori : KatType;
Beskrivelse : BeskrivType;
DAM : String[3];
CPU : String[15];
Dato : Array [1 .. 5] of String[10];
Rekvirent : Array [1 .. 5] of String[22];
Modtager : Array [1 .. 5] of String[22];
Udfoert : Array [1 .. 5] of String[22];
Pris : STRING[5];
Tid : STRING[40];
END;

KategoriType = Array [0 .. 30] of String[50];

Streng6 = String[6];
SogeKriterierType = Record
OpgaveNr : Streng6;
OpgaveNavn : String[50];
Kategori : KatType;
Beskrivelse : String[66];
DAM : String[3];
CPU : String[15];
DatoFra : String[10];
DatoTil : String[10];
Rekvirent : String[22];
Modtager : String[22];
Udfoert : String[22];
Pris : STRING[5];
Tid : STRING[40];
END;

--------------------------------------------------------------------------
----------------------------------------------------
Hope you can make anything of this
Terry Kreft skrev:
No it's not.

That could mean:-

FieldName1, FieldName2, FieldName3
Data1, Data2, Data3

or
Data1, Data2, Data3

or
"Data1", "Data2", "Data3"

or
"FieldName1", "FieldName2", "FieldName3"
"Data1", "Data2", "Data3"

or
FieldName1 FieldName2 FieldName3
Data1 Data2 Data3

or
Data1
Data2
Data3

or
FieldName1
FieldName2,
FieldName3
Data1
Data2
Data3

or
FieldName1 = Data1
FieldName2 = Data2
FieldName3 = Data3

or anyone of a number of other variations.

If you want some help jut show us some sample data.

--

Terry Kreft
<ja********@12move.dkwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Well
>
there are just text in the file if thats what you mean...
>
>
Terry Kreft skrev:
DAT is a file extension used by a number of different programs
without
knoing the format of these data files it's not possibl to answer
your
question.



--

Terry Kreft


<ja********@12move.dkwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi all
>
I was wondering if it was possible to some how import .DAT files
into
access form?
>
I have over 500 DAT files which contains infomation about various
components and I wouldn't want to rewrite all of them into Access
one
by one! Is there a way to convert the files so i can just import
the
files easy and fast.
>
If it isn't possible pls say so, so I can tell my boss that it
can't
be
done...waste of time trying to do something that can't be done
right.
>
>
many thanks
>
>

Oct 12 '06 #6

P: n/a
Thanks Terry

Will do.

Terry Kreft skrev:
I hate them when they're like that.

OK, what you need to do here is use File I/O to get each line from the file
and then assign it to the correct field. I appreciate the thought behind
putting the target fields in brackets but it doesn't really make it much
clearer to me as to what goes where so I'll talk in general about what you
need to do and if you need any more help we can take it from there.

So a bit of sample code to quickly read all the data from the file:-

Sub ImportData(FileName As String)
Dim intFF As Integer
Dim strLine As String
Dim varLines As Variant
Dim intLine As Integer

intFF = FreeFile

Open FileName For Binary Access Read Lock Read Write As intFF

strLine = Space(LOF(intFF))
Get intFF, , strLine
Close intFF

varLines = Split(strLine, vbCrLf)

' Now you can step through the varLines array
' and put the relevant data into the correct
' fields in your table.

End Sub

--

Terry Kreft
<ja********@12move.dkwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Ok this is one of the files opened in notepad
--------------------------------------------------------------------------
----------------------------------------------------000004
IRC2020 kommunikation
03
Seriel kommunikation mellem IRC 2020 omdrejningst'ller og PC.
Default : 9600,N,8,1
Mulighed for ops'tninger :
300/600/1200/2400/4800/9600 BAUD
NONE/ODD/EVEN parity
7/8 databit
1/2 stopbit

D
8031
6/11 1991
Ruud Min - Holland

SG






1500
--------------------------------------------------------------------------
----------------------------------------------------
Opened in access it looks like this. There isn't enough space so i have
just written which field they belong to in ( )

--------------------------------------------------------------------------
----------------------------------------------------

ID Field1 Field2 Field3 Field4
Field5
1 000004
2 IRC2020 kommunikation
3 03
4 Seriel kommunikation mellem IRC 2020(Field2)
omdrejningst'ller(Field3) og(Field4) PC.(Field5)
5 Default : 9600,N,8,1
6 Mulighed for ops'tninger :
7 300/600/1200/2400/4800/9600 BAUD(Field2)
8 NONE/ODD/EVEN parity
9 7/8 databit
10 1/2 stopbit
11
12 D
13 8031
14 6/11 1991
15 Ruud Min - Holland
16
17 SG
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 1500
35
--------------------------------------------------------------------------
----------------------------------------------------
And this is part of the code from the old program...if it helps in any
way.

--------------------------------------------------------------------------
----------------------------------------------------

TYPE
KatType = String[2];
BeskrivType = Array [0 .. 640] of Char;
KonstruktionsTabel = Record
OpgaveNr : LongInt;
OpgaveNavn : String[50];
Kategori : KatType;
Beskrivelse : BeskrivType;
DAM : String[3];
CPU : String[15];
Dato : Array [1 .. 5] of String[10];
Rekvirent : Array [1 .. 5] of String[22];
Modtager : Array [1 .. 5] of String[22];
Udfoert : Array [1 .. 5] of String[22];
Pris : STRING[5];
Tid : STRING[40];
END;

KategoriType = Array [0 .. 30] of String[50];

Streng6 = String[6];
SogeKriterierType = Record
OpgaveNr : Streng6;
OpgaveNavn : String[50];
Kategori : KatType;
Beskrivelse : String[66];
DAM : String[3];
CPU : String[15];
DatoFra : String[10];
DatoTil : String[10];
Rekvirent : String[22];
Modtager : String[22];
Udfoert : String[22];
Pris : STRING[5];
Tid : STRING[40];
END;

--------------------------------------------------------------------------
----------------------------------------------------
Hope you can make anything of this
Terry Kreft skrev:
No it's not.
>
That could mean:-
>
FieldName1, FieldName2, FieldName3
Data1, Data2, Data3
>
or
Data1, Data2, Data3
>
or
"Data1", "Data2", "Data3"
>
or
"FieldName1", "FieldName2", "FieldName3"
"Data1", "Data2", "Data3"
>
or
FieldName1 FieldName2 FieldName3
Data1 Data2 Data3
>
or
Data1
Data2
Data3
>
or
FieldName1
FieldName2,
FieldName3
Data1
Data2
Data3
>
or
FieldName1 = Data1
FieldName2 = Data2
FieldName3 = Data3
>
or anyone of a number of other variations.
>
If you want some help jut show us some sample data.
>
--
>
Terry Kreft
>
>
<ja********@12move.dkwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Well

there are just text in the file if thats what you mean...


Terry Kreft skrev:
DAT is a file extension used by a number of different programs
without
knoing the format of these data files it's not possibl to answer
your
question.
>
>
>
--
>
Terry Kreft
>
>
<ja********@12move.dkwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi all

I was wondering if it was possible to some how import .DAT files
into
access form?

I have over 500 DAT files which contains infomation about various
components and I wouldn't want to rewrite all of them into Access
one
by one! Is there a way to convert the files so i can just import
the
files easy and fast.

If it isn't possible pls say so, so I can tell my boss that it
can't
be
done...waste of time trying to do something that can't be done
right.


many thanks
Oct 13 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.