J
Jose I. Avila
All,
Is there a way to import many different tables using a SINGLE import file
specification using VB in Access 2000?
Thanks,
Jose
**************************************
Private Sub CmdStart_Click()
Const ForReading = 1
Dim fs, f, fullpath
Dim FileName As String ' file name
Dim fname As String ' table name = file name without the .txt
Dim PathFile
' Define text file
Set fs = CreateObject("Scripting.FileSystemObject")
fullpath = "Z:\CM System Files\data\files.txt"
Set f = fs.OpenTextFile(fullpath, ForReading)
Do While Not f.AtEndOfStream
FileName = f.ReadLine
fname = StrReverse(Mid(StrReverse(FileName), 5))
PathFile = "z:\cm system files\data\" & FileName
DoCmd.TransferText acImportDelim, "General_Import_Spec", fname,
PathFile, True, ""
Loop
f.Close
Set f = Nothing
Set fs = Nothing
End Sub
**************************************
Is there a way to import many different tables using a SINGLE import file
specification using VB in Access 2000?
Thanks,
Jose
**************************************
Private Sub CmdStart_Click()
Const ForReading = 1
Dim fs, f, fullpath
Dim FileName As String ' file name
Dim fname As String ' table name = file name without the .txt
Dim PathFile
' Define text file
Set fs = CreateObject("Scripting.FileSystemObject")
fullpath = "Z:\CM System Files\data\files.txt"
Set f = fs.OpenTextFile(fullpath, ForReading)
Do While Not f.AtEndOfStream
FileName = f.ReadLine
fname = StrReverse(Mid(StrReverse(FileName), 5))
PathFile = "z:\cm system files\data\" & FileName
DoCmd.TransferText acImportDelim, "General_Import_Spec", fname,
PathFile, True, ""
Loop
f.Close
Set f = Nothing
Set fs = Nothing
End Sub
**************************************