E
ecc28
Private Sub btnImportAllFiles_Click()
'procedure to import all files in a directory and delete
them.
'assumes they are all the correct format for an ASCII
delimited import.
Dim strfile As String
Dim strFileName As String
Dim strTable As String
I would like to import many csv files with the same file
name as same as table name to Access automatically.
I have tried the following module in Access but run button
is shadow. Please help and advise if any problem. Thanks.
ChDir ("d:\eric\test")
strfile = Dir("FileName*.*")
Do While Len(strfile) > 0
DoCmd.TransferText acImportDelim, strFileName,
strTable, "d:\eric\test" & strfile, True
'delete the file (consider moving it to an Archive
folder instead.)
Kill "d:\eric\test\" & strfile
strfile = Dir
Loop
End Sub
'procedure to import all files in a directory and delete
them.
'assumes they are all the correct format for an ASCII
delimited import.
Dim strfile As String
Dim strFileName As String
Dim strTable As String
I would like to import many csv files with the same file
name as same as table name to Access automatically.
I have tried the following module in Access but run button
is shadow. Please help and advise if any problem. Thanks.
ChDir ("d:\eric\test")
strfile = Dir("FileName*.*")
Do While Len(strfile) > 0
DoCmd.TransferText acImportDelim, strFileName,
strTable, "d:\eric\test" & strfile, True
'delete the file (consider moving it to an Archive
folder instead.)
Kill "d:\eric\test\" & strfile
strfile = Dir
Loop
End Sub