VB6 Read Text File
With this artcle, I am going to explain various ways we can Read Text File into a string variable using Classic VisualBasic.
The first and easy way to acess a txt file is using the simple open method available in VB. For this method, we need to allocate a unique file number for opening. And the same number should be used to close.
There are various modes to open some of them are Append, Binary, Input, Output, or Random. by default Random will be used.
In this code I have closed the connection after error has been handled(or intended to be handled). This close method will not do anything if the file number is not used to open. so it is safe even error has been occured before opening.
Using FileSystemObject in VB6 Read Text File
With FileSystemObject File IO operations are very easier in VB. Almost all the required functions are well defined. For reading, we hav ...