MS Access 2010 Import Specification Location?

2019-07-21 10:50发布

问题:

I have an MS Access DB where the Saved Imports inside the External Data has Import Jobs which are actually importing certain data from various locations to SOME tables. I am unable to find out which tables are actually imported with each of these jobs present there as the names given for these imports are unclear and unrelated. Is there any way I could find out to which table the import actually brings the data ?

回答1:

The items that appear when you click "Saved Imports" on the "External Data" tab are stored as ImportExportSpecification objects in the CurrentProject.ImportExportSpecifications collection. Each object has a .Name property and an .XML property (among others). The details of the import operation are in the XML data, for example

<?xml version="1.0"?>
<ImportExportSpecification Path="C:\Users\Public\zzz.csv" xmlns="urn:www.microsoft.com/office/access/imexspec">
    <ImportText TextFormat="Delimited" FirstRowHasNames="false" FieldDelimiter="," TextDelimiter="" CodePage="437" Destination="MyNewTable">
        <DateFormat DateOrder="YMD" DateDelimiter="-" TimeDelimiter=":" FourYearDates="true" DatesLeadingZeros="false"/>
        <NumberFormat DecimalSymbol="."/>
        <Columns PrimaryKey="id">
            <Column Name="Col1" FieldName="id" Indexed="YESDUPLICATES" SkipColumn="false" DataType="Long" Width="2"/>
            <Column Name="Col2" FieldName="textfield" Indexed="NO" SkipColumn="false" DataType="Text" Width="4"/>
        </Columns>
    </ImportText>
</ImportExportSpecification>

The Path= attribute of the <ImportExportSpecification> element indicates the location of the file to be imported.

The Destination= attribute of the <ImportText> element specifies the name of the table into which the data will be imported.