Robert88
Robbie
- Local time
- Today, 18:54
- Joined
- Dec 18, 2004
- Messages
- 335
I have created a button on a form in order to transfer text into a table tblPlanetarySystems from a file PlanetarySystems.txt. the code is as follows
Private Sub CmdReadFile_Click()
DoCmd.TransferText acImportDelim, , "tblPlanetarySystems", "C:\Planet\PlanetarySystems.txt", True
End Sub
a portion of the text file "PlanetarySystems.txt is as below
"Host Star", "Planet", "Distance from Earth", "Magnitude", "Planet Mass"
"16 Cygni", 16 Cygni b", 70, 6.2, 1.5
"47 Ursae Majoris", "47 Majoris b", 43, 5.1, 2.41
I have no probem with this but here is my problem. I have taken this out of a book and it works. The reason for using it is to use it on a key register. The key register has an *.ash file which I can change to *.txt and read the file like my example. However the file I am dealing with is not delimited, one line of it shown below
sample of one line of data from the *.ash file
2005110407000000114890180020000000087C44..............
If it was to be delimited it would have these properties.
Date, Time, Access Code (Each users is different)...........
20051104, 0700, 0000114890180020000000087C44............
So my question
, is it possible to read in such a file without delimitation? 
Currently I am getting a run time error 2391, Field F1 does not exist in table tblKey. The table I created tblKey has currently two fields fldDate_Time [Date/Time with general date format] and a field fldAccess [200 characters properties].
The data in this file has consistent field widths for each record and a line as shown represents a record. The data shown is only a portion of the data in one line which makes up a record but I figure this is a good enough sample, if not let me know and I can paste more.
Look forward to anyones input.
Best Regards
Private Sub CmdReadFile_Click()
DoCmd.TransferText acImportDelim, , "tblPlanetarySystems", "C:\Planet\PlanetarySystems.txt", True
End Sub
a portion of the text file "PlanetarySystems.txt is as below
"Host Star", "Planet", "Distance from Earth", "Magnitude", "Planet Mass"
"16 Cygni", 16 Cygni b", 70, 6.2, 1.5
"47 Ursae Majoris", "47 Majoris b", 43, 5.1, 2.41
I have no probem with this but here is my problem. I have taken this out of a book and it works. The reason for using it is to use it on a key register. The key register has an *.ash file which I can change to *.txt and read the file like my example. However the file I am dealing with is not delimited, one line of it shown below
sample of one line of data from the *.ash file
2005110407000000114890180020000000087C44..............
If it was to be delimited it would have these properties.
Date, Time, Access Code (Each users is different)...........
20051104, 0700, 0000114890180020000000087C44............
So my question


Currently I am getting a run time error 2391, Field F1 does not exist in table tblKey. The table I created tblKey has currently two fields fldDate_Time [Date/Time with general date format] and a field fldAccess [200 characters properties].
The data in this file has consistent field widths for each record and a line as shown represents a record. The data shown is only a portion of the data in one line which makes up a record but I figure this is a good enough sample, if not let me know and I can paste more.
Look forward to anyones input.
Best Regards
Last edited: