This is making me nuts - as short a hike as that is.
I have a CSV downloaded from a web based Database (I know it to be a PostgreSQL database) that has 32 columns - a combination of text, integers, one Double, a couple of boolean and a 3 dates.
The problem is with the date column. Looking at the original file in Excel the date column is “12/10/77”. In the following code, after the sRecord = tisTextInput.ReadLine, the sRecord variable contains the date column as 1977-12-10. The complete sRecord value is Candidate,506480,Mister,"",Nathan,Louis,Vick,"",Nathan,1977-12-10,Regular,0,8229 FM 1649,"",Gilmer,TX,75645-6571,"","",903.720.0401,1,YES,YES.
The only code that should execute is as follows:
Sub Open()
dim tisTextInput As TextInputStream
dim sRecord As String
Try
tisTextInput = TextInputStream.Open(Globals.fiFolderItem)
//tisTextInput.Encoding = Encodings.MacRoman
Catch e As IOException
tisTextInput.Close
MsgBox(“Error accessing file.”)
self.Close
End Try
If tisTextInput.EOF Then
MsgBox(“End of File”)
self.Close
End If
Listbox1.DeleteAllRows
sRecord = tisTextInput.ReadLine //first record contains column headings and isn’t used
Do
**sRecord = tisTextInput.ReadLine**
sFields = sRecord.Split(",")
ListBox1.AddRow(sFields())
Loop Until tisTextInput.EOF
Return
End Sub