programatically import a text file into access 97? cant work it out.

Wozzzzza

Registered User.
Local time
Yesterday, 22:33
Joined
Feb 3, 2007
Messages
27
i need to be able to have an access 97 database import a text file with a click of a button.
the text file is in a tab delimited format and i cant work out how to do this.
sample of the text file below, i only need to get the part where the numbers are and nothing above it in the database. it needs to go into a tabe with set fields and replace the existing data.
anyone give me any info of a vba function to do this i can modify? im stuck on one as there is no Split function in access 97 and cant work out how to place a line into an array to enable me to get the data out individually.

0***: ****** **** ******
******* List


090110 ****, ******** M 8BA 1B:4 08 ***
080211 *******, ****** M 9WA 2:11 09 ***
080248 ****, **** M 9WD 10:8 09 ***
070025 *****, ****** M FLOEL 1:20 09 ***
060175 *****, ****** F SB 16:1 11 ***




i have got so far that reads each line of the text file but cant split each line.

Sub ReadTextFile()

Dim fso As Object
Dim ts As Object
Dim strLine() As String

Set fso = CreateObject("scripting.filesystemobject")
Set ts = fso.opentextfile("c:\output.txt", 1)

Do While Not ts.atendofstream

MsgBox ts.readline
'cant work out how to split line up here

Loop

End Sub
 
cause the etext file has varying headings that i cant get around by other than code.

any way i have worked it out and got it all working using vba.
 

Users who are viewing this thread

Back
Top Bottom