CSV file import (1 Viewer)

dcarr

Trainee Database Analyst
Local time
Today, 08:55
Joined
Jun 19, 2002
Messages
112
This is the problem I am having. I am attemoting to import a CSV file into a temporary table in MS Access. I have set-up an import SPEC that lists the columns the data must go into.
I have wirtten a module, that automatically calculates the file to be imported from a location on my PC. The module should locate the fiel then paste the data into the correct column according to the SPEC.
It is copying the data but is using the top row of the CSV file as the column headingS, and is therefore missing a row that contains AD REVENUE details. It is importing everyting else. It is doing this even though, when creating the SPEC I ahve told the app that the first row contains data, any ideas?
I have also created an ODBC link to the data held within the folder, so it knows what it is looking for.
 

jatfill

Registered User.
Local time
Today, 03:55
Joined
Jun 4, 2001
Messages
150
If the module does the import and calls your existing specs, I'm guessing the existing line looks like this:

Code:
DoCmd.TransferText acImportDelim, "Specification Name", "Table Name", "Path to File", True, ""

Even though your import specification does not include the first row as titles, the next to the last arguement in the TransferText Method always indicates whether or not the file you are importing has field names. If this is the problem, just change your code to:

DoCmd.TransferText acImportDelim, "Specification Name", "Table Name", "Path to File", False, ""

The False flag tells Access you just have data, with no headers in your file.
 

Opengrave

Registered User.
Local time
Today, 02:55
Joined
Sep 6, 2001
Messages
70
Just a guess but could the space in AD REVENUE be causing the problem. Access might be looking for AD REVENUE but only see AD and stopping at the space. Try changing both to AD_REVENUE and see if it takes care of the problem. I've had lots of trouble caused by spaces in field/table names.
 

Users who are viewing this thread

Top Bottom