Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

importing CSV into Access 2010

Posted on 2013-05-28
1
Medium Priority
?
641 Views
Last Modified: 2013-06-01
Hi all,

I have a large .CSV file, with four columns ( three text data types and a date field).

One column, which is a text data type has contents with both alphanumeric ( FR347726, GB228765, 3987663, FR209878) and numeric data.

I created a button in an access form, that enables me to browse to file location and import the 'csv file' into a table.  The table data types are the same as cvs file ( date field and 2 text fields)

Problem is that all the alpha numeric data in the lost once the import into access table happens.

How can i prevent the alphanumeric data from being dropped, without tweaking the csv contents..Maybe some like of code? please help.

Thanks

lynmke
0
Comment
Question by:lynmke
1 Comment
 
LVL 26

Accepted Solution

by:
jerryb30 earned 2000 total points
ID: 39203149
You would want to create an import specification, which would allow you to establish the field as a text data type. Start importing a sample file, without using your browse function, and when you selected the file, Choose Advanced, set up field type, and Save As. Give the file spec a name, and use that in your import code.

docmd.TransferText acImportDelim, 'specName', 'destinationTableName','Sourcefilename',  etc
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

877 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