I need to read data from a legacy database file produced by Visual Basic 6.
From the legacy software I found that file was written using Put
and passing sort of records as parameters to the Put
function. These structures are defined as follows:
Type THE_TYPE
FIELD_1 As Single
FIELD_2 As String * 20
FIELD_3(1 To 50) As Single
FIELD_4(1 To 10) As String * 1
End Type
My Types are larger and more complex but I've put in THE_TYPE
the different definitions I have in my project. I've found that importing Microsoft.VisualBasic
gives me access to VB functions similar to those used to write the file, so I'm opening and closing the file with FileSystem.OpenFile()
and .CloseFile();
now I need to finally read data contained and since the original function was:
Public RecordContent As THE_TYPE
[...]
Get #1, recordNumber, RecordContent
I suppose I can use something similar, like Microsoft.VisualBasic.FileSystem.FileGet()
.
So the question is, how do I define a container, I suppose a class, similar to the original VB6 Type THE_TYPE
? How do I call .FileGet()
to correctly fill this object?