Help with csv import to Access table

Please support our MS Access and FileMaker Pro advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Feb 2009
Posts: 29
Reputation: mem81 is an unknown quantity at this point 
Solved Threads: 0
mem81 mem81 is offline Offline
Light Poster

Help with csv import to Access table

 
0
  #1
Sep 30th, 2009
Hello,

I have an access table where I have to import a csv file.
I have a very simple code in the Click _ Event Sub.
However it seems the code is ok, file gets imported but I get a separate table with errors in import.
In that table two fields are specified as error fileds.
The fields data type is numeric and I have set the filed definition in the table as number for both. I tried saving the problem fileds in the csv file as text and then in design view changed the fileds type to text. That did not work too.
What can I do to prevent a second "error" table to be created and the csv file to get imported in the access table ok ?

Here is my code:

Option Compare Database

Private Sub Command0_Click()
 DoCmd.TransferText acImportDelim, "File Import Specification", "File", "C:\File.csv", 0
End Sub

Thanks in advance
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 194
Reputation: HI2Japan is an unknown quantity at this point 
Solved Threads: 21
HI2Japan HI2Japan is offline Offline
Junior Poster

Re: Help with csv import to Access table

 
0
  #2
Sep 30th, 2009
What is the field size for the number fields in the table?
Who was the first person to look at a cow and say, "I think I'll squeeze these dangly things here, and drink whatever comes out!"
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 44
Reputation: boblarson is an unknown quantity at this point 
Solved Threads: 3
boblarson boblarson is offline Offline
Light Poster
 
0
  #3
Oct 10th, 2009
So you actually created an import specification which is called "File Import Specification?"

Perhaps if you haven't figured it out yet and want to send me your database file and your csv file, I can see what is up.

I can PM you my email address if you wish. Let me know.
Bob Larson, Access MVP
____________________________________
For Quick Tutorials and Samples for Microsoft Access: BTAB Development
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC