Hi,
I want to link multiple .txt files of different columns in access via VBA. I have made link spec named as " GCELL_Specifica tion" and using the following code.
The problem is Access is making same headers in all linked files as the headers of Spec. Its messing all the linked files. Can anyone tell me how to use a single spec in linking multiple tables of different headers.
Or can anyone tell me how to link without spec so that access takes datatype by default for each table. I tried this but access giving the error of 3011.
The code that i am using is :
I want to link multiple .txt files of different columns in access via VBA. I have made link spec named as " GCELL_Specifica tion" and using the following code.
The problem is Access is making same headers in all linked files as the headers of Spec. Its messing all the linked files. Can anyone tell me how to use a single spec in linking multiple tables of different headers.
Or can anyone tell me how to link without spec so that access takes datatype by default for each table. I tried this but access giving the error of 3011.
The code that i am using is :
Code:
Private Sub btn_dir_Click()
Dim objFSO As FileSystemObject
Dim objFile As File
Dim ObjDirRoot As Folder
Dim PageName As String
Set objFSO = New FileSystemObject
Set ObjDirRoot = objFSO.GetFolder("D:\Compiled DB\North")
For Each objFile In ObjDirRoot.Files
PageName = objFile.Name
DoCmd.TransferText acLinkDelim,"GCELL_Specification" , PageName, objFile.Name, True
Next
End Sub
Comment