Lots of Data in textfile problem reading each row
Posted on 2006-06-02
I am trying to read a textfile that has Avg. 3071 Chars. per line and Avg. 1K to 30K rows. When i go to read the InputLine it gives me all the data at once and not by row. How can I seperate each line, upload that line to Field and then go read next line and so on... If i open the file in Wordpad It has the lines seperated with an Avg. 3071 on each row.
Public Sub Upload2Server(TxtName As String, sFileID As String)
Dim FLen As Long
Dim V As Byte
Dim i As Long
Me.Caption = "Uploading File to the Server"
FLen = FileLen(TxtName)
ProgressBar1.Min = 1
ProgressBar1.Max = FLen
ProgressBar1.Value = 1
Open TxtName For Input As #1 ' Open file.
Do While Not EOF(1) ' Loop until end of file.
For i = 1 To FLen Step 2
ProgressBar1.Value = i
Line Input #1, TextLine ' Read line into variable.
sdb.OpenSQL_Data "SELECT * FROM Binary_Files WHERE FileID='" & sFileID & "';"
gdRS.Fields("Test") = gdRS.Fields("Test") & vbcrlf & TextLine