View Full Version : Importing CSV data


CB154
04-02-2007, 04:28 AM
Hi,

I have a database which I need to update several tables from CSV data files in differing locations. These are all date specific files and are all the same in terms of integrity. I only want to append data where the date is > than the last record for that item in the table. Is there any pointers you could give me here.

Thanks

Dennisk
04-02-2007, 04:45 AM
CB154
use a sub query to calculate the max date.

something like this:-

INSERT INTO [GMS_Cube_DataV3]
SELECT * FROM [Import_GMS_Cube_Data]

WHERE [ColumnDate] > (SELECT MAX(OtherDate) FROM [OtherTable])

CB154
04-02-2007, 05:18 AM
Hi,

Thanks

I did a more in depth serch here and found lots of help. I am using the code that i found however i am having issues with the DoCmd.TransferText.

So i wrote a macro to test this using the Transfer Text and i get an error You cannot import this file you cannot import a text file unless it has one of these extensions.

It is a txt file and I am unsure as to what is going wrong. any ideas would be great.

Dennisk
04-02-2007, 11:00 PM
Access has a list of standard text file extensions, .txt, .csv etc.
If your file extension is not in the registry then Access will not import it.
You can:-

1) change the file extension
2) add the extension to the permitted list in the registry. The key for this may vary so search the registry for .txt to find the text driver extensions.