I'm trying to get an old-style VB6 application to read a large (greater than 2GB) binary file. I declare a buffer as:
Dim TCBuffer as String
TCPBuffer = String(4096, Chr(0))
And read the data in a loop using:
Get #FileNum, , TCPBuffer
But once the current position reaches 2GB, the line above raises an error.
Run-time error '63':
Bad record number
So I wondered about using Scripting.FileSystemObject
instead. However, it appears this object is very limited. For one thing, it appears you can only create and open text files.
Any suggestions on how I can read a large binary file from VB6?
UPDATE:
Thinking about this some more, another option would be to use API functions. But one of the real limitations of VB6 here is the lack of unsigned data types. So even using API functions would be a trick.