![]() |
|
|
#1
|
|||
|
|||
|
Hello there,
I have a macro to import multiple csv files to acess. but when i do this with the code attached it doesnt work. the import process creates a lot of error tables which has errors like "Unparsable Record", "Field Truncated" and etc.. Code:
Function Importcsv()
Dim fs, fldr, fls, fl
Set fs = CreateObject("Scripting.FileSystemObject")
Set fldr = fs.getfolder("E:\Data As It Is\Conf\ImportGenius_murrali2\To Vishnu\")
Set fls = fldr.files
For Each fl In fls
If Right(fl.Name, 4) = ".csv" Then
DoCmd.TransferText acImportDelim, , "M1", "E:\Data As It Is\Conf\ImportGenius_murrali2\To Vishnu\" & fl.Name, True
End If
Next fl
End Function
what might be the problem in my code. Thanks in Advance. -- Regards, Vivek Palanissamy |
|
#2
|
|||
|
|||
|
Sub importDossier(ByVal strDossier As String)
If Dir(strDossier, vbDirectory) = "" Then MsgBox "not found !", vbExclamation Exit Sub End If strFichier = Dir(strDossier) While strFichier <> "" Debug.Print strFichier DoCmd.TransferText acImportDelim, ";", strFichier, strDossier & strFichier, True, "" strFichier = Dir Wend End Sub Raafat Maurice Aziz |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| error in macro | nawaray | Access | 0 | 02-10-2009 09:06 AM |
| Import large txt into access | klm127 | Import/Export Data | 0 | 04-23-2007 04:22 AM |
| Import Lotus Notes address book into a MS Access table. | acheo | Import/Export Data | 0 | 02-19-2007 11:43 AM |
| import an excell spreadsheet in an access database | lmichaud | Import/Export Data | 0 | 11-03-2006 05:29 AM |
| Unable to import or link tables through odbc in Access SP2 | Dave Jenkins | Import/Export Data | 3 | 11-09-2005 08:51 AM |