How to increase performance for bulk INSERTs to ODBC linked tables in Access?

后端 未结 3 1309
一向
一向 2020-11-27 22:10

I have CSV and TXT files to import. I am importing the files into Access and then inserting the records into a linked Oracle table. Each file has around 3 million rows and t

3条回答
  •  时光说笑
    2020-11-27 23:16

    Sorry, I forgot to include the code:

    Option Compare Database
    Option Explicit
    
    Public Function Run_Safe_SQL(strSQL)
    On Error GoTo Error_Handler
    Dim db As DAO.Database
    
       Set db = CurrentDb()
       db.Execute strSQL, dbFailOnError
       DBEngine.Idle dbRefreshCache
    '   DoEvents
    
    Exit_Here:
       'Cleanup
       Set db = Nothing
       strSQL = ""
       Exit Function
    
    Error_Handler:
        MsgBox Err.Description & " " & Err.Number
    
    End Function
    

提交回复
热议问题