DoCmd.TransferText only if file is new
A delimited text file should be updated daily and I only want the file's contents imported if the file is new.
Thank you for taking the time to report an issue.
What's wrong... Please write below.
1) DoCmd.TransferText acImportDelim, "202DailyListImportSpecification", "tmp_202", cleanfile, False
that does not cooperate at all. The first 11 fields from the text file are imported in the first field of the table.
In either case, I do the import in a newly created table.
this is my code:
DoCmd.TransferText acImportDelim, "IMPORT", _
"AMEX", "volbyclass-amex.txt", -1
my text file is in the same directory as my access database but it doesn't work. it gives me an error that it cannot find the file.
If I put the whole path (ex: c:\.) it works perfectly but I obviously don't want to do that because it won't be portable. what am I missing
The action or method requires a Specification Name argument.
I have created the Spec file by doing the export clicking on the advanced tab creating my field sizes and saving the spec file (ClaimsExportSpecs). If I run the export manually everything works fine.
I've also tried the Schema.ini file and put it in the same directory I'm putting my export file. The Schema.ini gives me a Run-time error '424': Object Required error.
My code is:
DoCmd.TransferText acExportFixed, ClaimsExportSpecs, "qryExport", "C:\Export Test\ExportTest.txt"
and/or (trying both ways)
DoCmd.TransferText acExportFixed, Schema.ini, "qryExport", "C:\Export Test\ExportTest.txt"
doing an acExportDelim works fine but I need it in fixed format
The problem that arises sometimes is when the file I am grabbing has delimiter errors in it.
Access is still importing the file but it is not producing an error. I have error trapping in it but it is not coming up with anything. Instead Access is making a table that has a reference to the import error. Users do not see the tables of course and they may not notice an error in their data.
Anyone know of a way for me to detect this error so I can alert the user to check their import file
DoCmd.TransferText acImportDelim, "", tbl7480Errors, str7480ErorrsPath, True
DoCmd.TransferText acImportDelim,, tbl7480Errors, str7480ErorrsPath, True
And it just keeps saying "The action or method requires a table name argument", but the table name's there.
I do not want to create an import spec - MS's documentation is clear that this can be omitted where the file is delimited.
It's a CSV file, and the table has been created already
I used the DoCmd.transferText Statement
DoCmd.TransferText acImportFixed = 1, , "NewImport", "W:\NewImport.txt
It imported as one record creating field names field1.field255.
What I really want it import it as is one field with as many records as it needs.