I have about 10 years of hourly data, I can open it in excel and then import it to Access, but it takes very long, and it also passed the 65,000 row limit in excel.
And I only need 5 columns from above, not all of the data
This is my code so far.
Dim fso As New FileSystemObjectDim ts As TextStreamDim Data As StringDim sFileToGet As StringDim start_Date, St_Time As DateDim Mean, St_Dev As DoubleDim n As IntegersFileToGet = cbo_fileName1.TextSet ts = fso.OpenTextFile(sFileToGet)Data = ts.ReadLineDim cmd_ToAccess2 As New ADODB.CommandDim RS_ToAccess2 As New ADODB.RecordsetWith cmd_ToAccess2 .ActiveConnection = m_Conn .CommandText = " Select * From tbl_MathIntegration;" .CommandType = adCmdTextEnd With With RS_ToAccess2 .CursorType = adOpenStatic .CursorLocation = adUseClient .LockType = adLockOptimistic .Open cmd_ToAccess2End withDo While ts.AtEndOfStream <> Truestart_Date = Format(DecimaltoDate(Left$(Data, 16)), "dd-mm-yyyy")St_Time = Format(DecimaltoDate(Left$(Data, 16)), "hh:mm")Mean = Mid$(Data, 28, 7)St_Dev = Mid$(Data, 35, 7)n = Mid$(Data, 45, 2)RS_ToAccess2.AddNewRS_ToAccess2!StartDate = start_DateRS_ToAccess2!StartTime = St_TimeRS_ToAccess2!Mean = MeanRS_ToAccess2!St_Dev = St_DevRS_ToAccess2!n = nRS_ToAccess2.MoveNextData = ts.ReadLineLoopts.CloseSet RS_ToAccess2 = Nothing