Solved

importing CSV into Access 2010

Posted on 2013-05-28
1
576 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 500 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now