I'm trying to open old VB6 files which were created using random access.
The Type used was as follows:
Type CDB
dateCreated As Date
lastModified As Date
companyName As String * 30
ownerName As String * 30
contactName As String * 30
addresss As String * 100
tel As String * 75
vat As String * 8
BRegd As String * 9
End Type
And access was as follows:
Dim CDB As CDB
Open "CLIENTS.DAT" For Random As #1 Len = Len(CDB)
Lastrec = LOF(1) / Len(CDB)
For rec = 1 To Lastrec
Get #1, rec, CDB
txtDateCreated.Text = Format(CDB.dateCreated, "dd/mm/yyyy")
txtLastModified.Text = Format(CDB.lastModified, "dd/mm/yyyy")
txtCompanyName.Text = Trim(CDB.companyName)
... and so on
Next
Now I want to open this file using C# and import all the data in a SQL datatable. Could anyone help me to open this file using the Type CDB as structure?