Her's my code:
'import KanBan spreadsheet
If (MsgBox("Are you sure you want to delete the tblnameTable?", vbYesNo, "Warning!!! This operation can not be reversed")) = vbYes Then
'first delete old table
DoCmd.DeleteObject acTable, "tbltableName"
'copy new table from template, resets ID field
DoCmd.CopyObject , "tblTableName", acTable, "TableNameTemplate"
'import ; deliminted table using import spec
DoCmd.TransferText acImportDelim, "tblTableNameImportSpecification", "tblTableNameImport", "C:\ProplannerProcessing\FolderDownload\ImportFile10042010v1.txt", 0
What happens is the Import Specification (thank you Bill G for changing the name , used to be Schema) specifies ";" delim and in the file I am importing it has fields with quotes around individual letters. Example
;02452 ;BLUE ;06032031 ;M46 L;T1934L;1910 ;000003900;000;NUT/SPRG."U"1TH;K02A03 ;230C ;V;500;PC;A;02452 N;Y; ;
NUT/SPRG."U"1TH is the problem.
The field is a description field and the data has to remain as is.
The import spec(s) brings in everything except rows with this type of data. I get the table for import errors in Access and it is saying "Unparsable Record" with the row number. I am assuming that the problem is the quotes.
I have tried to use an Import Spec with a Text Qualifier as {None} and/or " with the same results "Unparsable Record" and losing those records.
Any ideas as to how I would import the ; delim file and include records with fields containing quotes?
Can I open the txt file and loop throug and .addnew to the table? There are also CR/LF characters in the file that I remove later using a query.
ideas, gentle nudges, epiphanies?
Thanks in advance,
Jeol
Joel
'import KanBan spreadsheet
If (MsgBox("Are you sure you want to delete the tblnameTable?", vbYesNo, "Warning!!! This operation can not be reversed")) = vbYes Then
'first delete old table
DoCmd.DeleteObject acTable, "tbltableName"
'copy new table from template, resets ID field
DoCmd.CopyObject , "tblTableName", acTable, "TableNameTemplate"
'import ; deliminted table using import spec
DoCmd.TransferText acImportDelim, "tblTableNameImportSpecification", "tblTableNameImport", "C:\ProplannerProcessing\FolderDownload\ImportFile10042010v1.txt", 0
What happens is the Import Specification (thank you Bill G for changing the name , used to be Schema) specifies ";" delim and in the file I am importing it has fields with quotes around individual letters. Example
;02452 ;BLUE ;06032031 ;M46 L;T1934L;1910 ;000003900;000;NUT/SPRG."U"1TH;K02A03 ;230C ;V;500;PC;A;02452 N;Y; ;
NUT/SPRG."U"1TH is the problem.
The field is a description field and the data has to remain as is.
The import spec(s) brings in everything except rows with this type of data. I get the table for import errors in Access and it is saying "Unparsable Record" with the row number. I am assuming that the problem is the quotes.
I have tried to use an Import Spec with a Text Qualifier as {None} and/or " with the same results "Unparsable Record" and losing those records.
Any ideas as to how I would import the ; delim file and include records with fields containing quotes?
Can I open the txt file and loop throug and .addnew to the table? There are also CR/LF characters in the file that I remove later using a query.
ideas, gentle nudges, epiphanies?
Thanks in advance,
Jeol
Joel