I need to read data from text files and use the same in my application. Im using VB 6.0. What commands do I use? Some Sample code would be highly appreciated.
+3
A:
A full tutorial and sample code can be found here
Open Filename$ For Input As #FileHandle
Do While Not EOF(FileHandle) ' Loop until end of file
Line Input #FileHandle, TextLine$ ' Read line into variable
' Your code here
Loop
Close #FileHandle
David Sykes
2010-05-20 12:54:34
Thanks David, Andy
Jack Njiri
2010-05-20 13:08:56
+1
A:
Here's how to read an entire text file into a string - from the VB6 manual.
Open strFilename For Input As #iFile
strTheData = StrConv(InputB(LOF(iFile), iFile), vbUnicode)
Close #iFile
MarkJ
2010-05-20 15:29:25