Ok, me again. When I add the records into the database, I am getting the aryFields(#) instead the called index in the array. I look at everything and can't see why I'm not getting the desired data instead of the aryFields() written into the database. Uugh.

Private Sub btnLoadFromText_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoadFromText.Click
        'declare the database
        Dim db As New dbUpdt
        Dim strRecord As String    ' for each line (record) from the CSV file
        Dim aryFields() As String ' array to contain fields
        Dim strID As String       ' for the station ID
        'declare the source of the database file

        'create connection to the database
        db.openConnection("weather.mdb")
        'open & read text
        Dim stationsFile As StreamReader = File.OpenText("stationsIn.csv")
        ' continue processing until I hit the end of CSV file
        Do Until stationsFile.EndOfStream

            ' read a record and split into fields
            strRecord = stationsFile.ReadLine
            aryFields = Split(strRecord, ",")

            ' Determine the value of the key field
            strID = aryFields(0)
            db.addRecord("stations", "StationID", "aryFields(0)")
            db.setField("stations", "StationID", "aryFields(0)", "StationName", "aryFields(1)")
            db.setField("stations", "StationID", "aryFields(0)", "State", "aryFields(2)")
        Loop
        ' read one line and store in database
    End Sub

ok, solved my own issue, just removed the quotation marks around the aryFields(#)

db.addRecord("stations", "StationID", aryFields(0))
db.setField("stations", "StationID", aryFields(0), "StationName", aryFields(1))
db.setField("stations", "StationID", aryFields(0), "State", aryFields(2))
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.