I am linking to a csv file using ADOX but would like to know if I can use an import spec on the linked table like I can if I use.
DoCmd.TransferText "import_Spec", "tblName"
My code at the moment is
Any help would be appreciated.
Thanks in advance
Jonathan
DoCmd.TransferText "import_Spec", "tblName"
My code at the moment is
Code:
Dim App_Cnn As ADODB.Connection
Dim cat As New ADOX.Catalog
Dim tbl As New ADOX.Table
Set App_Cnn = New ADODB.Connection
With App_Cnn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source") = "c:\MHMDSWorkFolder\Blank2000.mdb"
.Properties("Mode") = adModeReadWrite
.Properties("Jet OLEDB:Engine Type") = 5
.Properties("Locale Identifier") = 1033
.Open
End With
'Linking new file to DB
Set cat.ActiveConnection = App_Cnn
Set tbl.ParentCatalog = cat
With tbl
.Properties("Jet OLEDB:Create Link") = True
.Properties("Jet OLEDB:Link Provider String") = "Text"
.Properties("Jet OLEDB:Link Datasource") = "c:\MHMDSWorkFolder\ImportFiles"
.Properties("Jet OLEDB:Remote Table Name") = csvFile
.Name = "N_" & impTbl
End With
cat.Tables.Append tbl
cat.Tables.Refresh
Any help would be appreciated.
Thanks in advance
Jonathan