?
Solved

Transfer data from excel to Acess using access VBA

Posted on 2014-02-03
4
Medium Priority
?
1,738 Views
Last Modified: 2014-02-05
What do you think is the most eficient way to export data from excel into access.
We have very large excel file with about 0.5 Millions records , I need to transfer it into access table.

I have a way to do it, but it is VERY slow.  I did a procedure where i first do a linktable to excel file and then i run append query. It take very long time to run. Any other more efficient way to do it?
0
Comment
Question by:maximyshka
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 31

Expert Comment

by:gowflow
ID: 39830828
It can be done the other way around have a macro in VB that export data to the access table however this need to be tested as do not know the time frame of execution when it comes to 05 million record. How many fields you have there ?
gowflow
0
 
LVL 25

Accepted Solution

by:
chaau earned 2000 total points
ID: 39830830
I think DoCmd.TransferSpreadsheet should be the fastest:
Dim strXls As String
strXls = "c:\Temp\temp.xls"
DoCmd.TransferSpreadsheet acImport, , "tblExcel", strXls, True, "temp!"

Open in new window

After the import data will be in the table called "tblExcel". You can then run your Append query. Alternatively, you can call DoCmd.TransferSpreadsheet to import directly into your existing table
0
 
LVL 46

Expert Comment

by:aikimark
ID: 39831633
it is VERY slow

1. What actual times are you observing?
2. How big is the Excel workbook?
3. How big is the Excel worksheet?
4. Have you compacted your database recently?
5. How much free RAM (physical memory) do you have when you do the import?
6. Are you importing to an empty table or appending to an existing table?
7. Does the Access table have any indexes?
8. What does your Append query look like?
9. What does your VBA code look like?
10. Are the workbook and database on your local hard drive?
0
 

Author Closing Comment

by:maximyshka
ID: 39835802
This is what seems to be woring the best
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question