Solved

importing CSV into Access 2010

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

786 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