Hi,
We have a process that loads a Microsoft Access database. The software is written in VB 2010 32-bit and using OLEdB. The software runs on Windowds XP and Windows 7. My concern is the amount of time to load the database. There are seven tables and the amount of records inserted depends on the users request. Currently, I am testing with 50,300 records and it takes 11 minutes to insert these records. Each table varies with the number of columns. I need to improve the performance of this process and do not know where to start. Below is a sample of the code:
Dim strSQL As String
strSQL = "INSERT INTO FI(" & _
"[TGSN], " & _
"[MEAS_PRD], " & _
"[BASE_YEAR], " & _
"[REQ_MO1], " & _
"[REQ_TRKS1], " & _
"[REQ_MO2], " & _
"[REQ_TRKS2], " & _
"[REQ_MO3], " & _
"[REQ_TRKS3], " & _
"[REQ_MO4], " & _
"[REQ_TRKS4], " & _
"[REQ_MO5], " & _
"[REQ_TRKS5], " & _
"[REQ_MO6], " & _
"[REQ_TRKS6]) " & _
"VALUES('" & Downloaded_Rec_FI.tgsn & "', '" & _
Downloaded_Rec_FI.meas_prd & "', '" & _
Downloaded_Rec_FI.Base_Year & "', '" & _
arrForecastYears(0).Req_Mo & "', '" & _
arrForecastYears(0).Req_Trks & "', '" & _
arrForecastYears(1).Req_Mo & "', '" & _
arrForecastYears(1).Req_Trks & "', '" & _
arrForecastYears(2).Req_Mo & "', '" & _
arrForecastYears(2).Req_Trks & "', '" & _
arrForecastYears(3).Req_Mo & "', '" & _
arrForecastYears(3).Req_Trks & "', '" & _
arrForecastYears(4).Req_Mo & "', '" & _
arrForecastYears(4).Req_Trks & "', '" & _
arrForecastYears(5).Req_Mo & "', '" & _
arrForecastYears(5).Req_Trks & "')"
Using cmd As New OleDbCommand(strSQL, cnnNew)
cmd.ExecuteNonQuery()
cmd.Dispose()
End Using
------------------------------- END OF CODE ------------------------------------------
All Inserts into table are very similar in nature.
Any ideas?
Thanks!!
The process is written in
We have a process that loads a Microsoft Access database. The software is written in VB 2010 32-bit and using OLEdB. The software runs on Windowds XP and Windows 7. My concern is the amount of time to load the database. There are seven tables and the amount of records inserted depends on the users request. Currently, I am testing with 50,300 records and it takes 11 minutes to insert these records. Each table varies with the number of columns. I need to improve the performance of this process and do not know where to start. Below is a sample of the code:
Dim strSQL As String
strSQL = "INSERT INTO FI(" & _
"[TGSN], " & _
"[MEAS_PRD], " & _
"[BASE_YEAR], " & _
"[REQ_MO1], " & _
"[REQ_TRKS1], " & _
"[REQ_MO2], " & _
"[REQ_TRKS2], " & _
"[REQ_MO3], " & _
"[REQ_TRKS3], " & _
"[REQ_MO4], " & _
"[REQ_TRKS4], " & _
"[REQ_MO5], " & _
"[REQ_TRKS5], " & _
"[REQ_MO6], " & _
"[REQ_TRKS6]) " & _
"VALUES('" & Downloaded_Rec_FI.tgsn & "', '" & _
Downloaded_Rec_FI.meas_prd & "', '" & _
Downloaded_Rec_FI.Base_Year & "', '" & _
arrForecastYears(0).Req_Mo & "', '" & _
arrForecastYears(0).Req_Trks & "', '" & _
arrForecastYears(1).Req_Mo & "', '" & _
arrForecastYears(1).Req_Trks & "', '" & _
arrForecastYears(2).Req_Mo & "', '" & _
arrForecastYears(2).Req_Trks & "', '" & _
arrForecastYears(3).Req_Mo & "', '" & _
arrForecastYears(3).Req_Trks & "', '" & _
arrForecastYears(4).Req_Mo & "', '" & _
arrForecastYears(4).Req_Trks & "', '" & _
arrForecastYears(5).Req_Mo & "', '" & _
arrForecastYears(5).Req_Trks & "')"
Using cmd As New OleDbCommand(strSQL, cnnNew)
cmd.ExecuteNonQuery()
cmd.Dispose()
End Using
------------------------------- END OF CODE ------------------------------------------
All Inserts into table are very similar in nature.
Any ideas?
Thanks!!
The process is written in