By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,506 Members | 2,297 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,506 IT Pros & Developers. It's quick & easy.

Parse excel, rft or csv file into MS Access database

P: 3
I am new to these database field and i am not sure how to start the project. can anyone please help me in this.
I have different files like excel,csv or rft files i need to write some vba code to import those files into the MS Access database.
Jul 10 '17 #1
Share this Question
Share on Google+
5 Replies


P: 7
All three can be done, though rtf is a more complicated. For excel for example you can use the TransferSpreadsheet command like this docmd.transferspreadsheet acImport, acSpreadsheet TypeExel12, "Table Name in access", "Path and File Name", true

The true here means that the first row will be column names.

for the csv you would use the TransferText.
Jul 11 '17 #2

P: 3
thanks for replying, but docmd.transferspreadsheet will import the whole file into ms access but i need some of the columns to be imported and some are not.
Jul 11 '17 #3

P: 7
What version of access are you using, if before 2016 there is a way to select the columns you want, otherwise you can import the whole thing and remove the columns you want. You can also import using all vba code.
Jul 11 '17 #4

P: 3
MS Access version 2010. Is it possible to write any code using shell script or perl script?
Jul 11 '17 #5

P: 7
You need to manually import the spreadsheet first and when doing to save the import specifications, and that's where you can tell it what columns you want to import. Then when you do the transferspreadsheet command just add the specification name at the end. Perl, No. I don't know what you are referring to when you say shell script.
Jul 12 '17 #6

Post your reply

Sign in to post your reply or Sign up for a free account.