Need your help how to import CSV file to Access..

jerry28ph

jerry
Local time
Today, 09:44
Joined
Nov 16, 2008
Messages
141
Hi All,

I'm doing a project on day to day Call Log Sheet and the details are saved in a folder named "callLog.csv" file.

Here is the sample fields and record:
----------------------------------
Call Start : 7:02
Call duration : 00:00:41
Ring duration : 3
Caller : 202-1020
Direction : I
Called No : 155511
Dialled No : 155511

----------------------------------

I would like to ask from you on how I can import and save the sample record into Access table ( I created the .mdb file and table with the same field). I want to use form, command buttons and SQL to perform this task. I have basic knowledge in SQL and working with databases and tables. I will appreciate any help that you may share with me. With your help I know I could make it.

Thank you in advance.

Best regards,
Jerry
 
Hi All,

I'm doing a project on day to day Call Log Sheet and the details are saved in a folder named "callLog.csv" file.

Here is the sample fields and record:
----------------------------------
Call Start : 7:02
Call duration : 00:00:41
Ring duration : 3
Caller : 202-1020
Direction : I
Called No : 155511
Dialled No : 155511
----------------------------------

Jerry
Just to be clear - I don't see any commas in that sample. The real CSV file has commas, right? Assuming that to be the case, you can do:

On Error Resume Next
CurrentDB.Execute "DROP TABLE DestTable"
On Error GoTo 0
DoCmd.TransferText acImportDelim, , "DestTable", "C:\MyCSVFile.csv", True
 
BTW, Here's another sample

CurrentDb.Execute "SELECT * into DestTable FROM [Text; FMT=Delimited; HDR=YES; CharacterSet=437; DATABASE=C:\].[MyCSVfile.CSV]"
 

Users who are viewing this thread

Back
Top Bottom