VBA/SQL: The fastest way to send data from Excel sheet into Access database

  • Hello, I believe that's question for some experienced users. I'm looking for the fastest way of sending data from Excel sheet to Access database. The shape of sheet looks like this:


    ID Description
    10 kjdsaljdlaksd
    11 asddsaj
    12 asdads


    etc.


    Currently I'm using code:



    I know that I can also use SQL mixed with VBA.


    Would it be faster? Would I feel the difference? Is there any other way to do this (fastest possible of course)?

  • Re: VBA/SQL: The fastest way to send data from Excel sheet into Access database


    I did some research and managed to do adding data to Access database using SQL. Here's the code:



    I've compared time used for running macro from previous post and this one.


    Results:
    VBA: 1000 records, running time: 3,07s
    SQL: 1000 records, running time: 0,89s


    VBA: 10000 records, running time: 6,07s
    SQL: 10000 records, running time: 9,98s


    As we can see, running time depends on number of records and after crossing some number of them, SQL is just slower.


    Question for you: do you know how to add records to database but using whole range?
    Current solution uses for loop to achieve desired effect. I've tried to find some informations how to do it, but I miserably failed.

  • Re: VBA/SQL: The fastest way to send data from Excel sheet into Access database


    If you've got access to SSIS that will be the fastest way of getting data into access...

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!