473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

:DAT import to access

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
6 8076
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Piedro | last post by:
Hi y'all I'm having some trouble with the following script I use in a dts-package. I use it to automatically import a dat-file of which the name changes every day. Today the name f.e. is...
4
by: Christian R | last post by:
Hello, Is there somebody ho can tell me how to import a '.dat' file in Microsoft SQL Server 2000 Developer? The '.dat' file contain a fully database, with many different tables. Each of...
2
by: Thanos | last post by:
Hello, I need some help with a small problem. I have a fixed length format dat file with the first and last lines been the header and trailer file information. The header, body and trailer...
5
by: B-Dog | last post by:
I have an old dos program that uses dat files to store the data and I'm trying to convert to dotnet. I'd like to be able to import the data into an access database but I don't know which format...
0
by: EPDJ | last post by:
Well, I have to edit a program which we previously used for reading a header file to be able to read a trailer from a .dat file. The .dat file consists of 5 entries in each record and I am assuming...
0
by: lenn26 | last post by:
It is possible to import .dat file to access database? Please send me a source code. I badly need it in developing my software.Thank You!
0
by: lenn26 | last post by:
How can I import a .dat file extension into an excel file? Actually I'm looking for a code that can import a .dat file to excel but I can't find one. Please help me if there's anyone can suggests....
23
by: mbatestblrock | last post by:
okay... So this is my first post. this was my last resort after searching for three days straight.. so Ill just jump RIGHT in and pray that someone can help me out. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.